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

should

Package Overview
Dependencies
Maintainers
4
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 2.0.2 to 2.1.0

5

History.md

@@ -0,1 +1,6 @@

2.1.0 / 2013-11-11
==================
* Override .inspect for Date's to convert them to ISOString
2.0.2 / 2013-10-21

@@ -2,0 +7,0 @@ ==================

5

lib/should.js

@@ -27,3 +27,6 @@ /*!

should.inspect = inspect;
should.inspect = function(obj, opts) {
if(util.isDate(obj) && typeof obj.inspect !== 'function') obj = obj.toISOString();
return inspect(obj, opts);
};

@@ -30,0 +33,0 @@ /**

2

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

@@ -5,0 +5,0 @@ , "repository": { "type": "git", "url": "git://github.com/visionmedia/should.js.git" }

@@ -45,4 +45,14 @@ # should.js

Some assertions can be chained, for example if a property is volatile we can first assert property existence:
Every assertion will return a should.js-wraped Object, so assertions can be chained. For example:
```js
user.should.be.an.instanceOf(Object).and.have.property('name', 'tj');
user.pets.should.be.instanceof(Array).and.have.lengthOf(4);
```
All assertions return themselves but not `property` and `ownProperty`. They two would return the property value.
for example if a property is volatile we can first assert property existence:
```javascript
// `user.should.have.property('pets')` returned `should(user.pets)` but not `should(user)`
user.should.have.property('pets').with.lengthOf(4)

@@ -54,3 +64,4 @@ ```

```
our dummy getters such as _a_, _an_, _be_ and _have_ make tests more readable while the getters _and_ and _with_ helps express chaining:
our dummy getters such as _a_, _an_, _be_, _of_ and _have_ make tests more readable while the getters _and_ and _with_ helps express chaining:
```javascript

@@ -60,2 +71,3 @@ user.should.be.an.instanceOf(Object).and.have.property('name', 'tj')

```
Those getters don't have any actual effect, just for readability.

@@ -162,4 +174,4 @@ ## static

```javascript
user.should.have.type('object')
'test'.should.have.type('string')
user.should.be.type('object')
'test'.should.be.type('string')
```

@@ -166,0 +178,0 @@ ## instanceof and instanceOf

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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