Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

should

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

should - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

6

History.md
0.5.1 / 2012-01-13
==================
* Added better `.json`
* Added better `.html`
0.5.0 / 2012-01-12

@@ -3,0 +9,0 @@ ==================

10

lib/should.js

@@ -35,3 +35,3 @@ /*!

exports.version = '0.5.0';
exports.version = '0.5.1';

@@ -617,3 +617,5 @@ /**

get json() {
this.obj.should.have.header('content-type', 'application/json; charset=utf-8');
this.obj.should.have.property('headers');
this.obj.headers.should.have.property('content-type');
this.obj.headers['content-type'].should.include('application/json');
},

@@ -629,3 +631,5 @@

get html() {
this.obj.should.have.header('content-type', 'text/html; charset=utf-8');
this.obj.should.have.property('headers');
this.obj.headers.should.have.property('content-type');
this.obj.headers['content-type'].should.include('text/html');
},

@@ -632,0 +636,0 @@

{ "name": "should"
, "description": "test framework agnostic BDD-style assertions"
, "version": "0.5.0"
, "version": "0.5.1"
, "author": "TJ Holowaychuk <tj@vision-media.ca>"

@@ -5,0 +5,0 @@ , "contributors": [ "Aseem Kishore <aseem.kishore@gmail.com>" ]

@@ -260,3 +260,3 @@ _should_ is an expressive, readable, test framework agnostic, assertion library for [node](http://nodejs.org).

Assert that an object equal to the given `obj` is present in an Array:
Assert that an object equal to the given `obj` is present in an Array:

@@ -269,9 +269,18 @@ [[1],[2],[3]].should.includeEql([3])

Assert exceptions:
Assert an exception is thrown:
```js
(function(){
throw new Error('fail');
}).should.throw();
```
Assert an exception is not thrown:
```js
(function(){
}).should.not.throw();
```
Assert exepection message matches string:

@@ -281,5 +290,13 @@ ```js

throw new Error('fail');
}).should.throw();
}).should.throw('fail');
```
Assert exepection message matches regexp:
```js
(function(){
throw new Error('failed to foo');
}).should.throw(/^fail/);
```
## keys

@@ -286,0 +303,0 @@

@@ -243,3 +243,21 @@

},
'test .json': function(){
var req = {
headers: {
'content-type': 'application/json'
}
};
req.should.be.json;
var req = {
headers: {
'content-type': 'application/json; charset=utf-8'
}
};
req.should.be.json;
},
'test equal(val)': function(){

@@ -246,0 +264,0 @@ 'test'.should.equal('test');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc