Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "chaid", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Id equality assertions for chai", | ||
@@ -8,2 +8,4 @@ "author": "Adam Hull <adam@hmlad.com>", | ||
"chai", | ||
"chai-plugin", | ||
"browser", | ||
"plugin", | ||
@@ -10,0 +12,0 @@ "id", |
@@ -13,2 +13,3 @@ chaId | ||
{_id: 'foo'}.should.have.id('foo') | ||
'foo'.should.id({id: 'foo'}) | ||
{id: 'foo', bar: 2}.should.have.same.id({id: 'foo', baz: 3}) | ||
@@ -22,2 +23,3 @@ {_id: 'foo'}.should.not.have.same.id({_id: 'bar'}) | ||
[{id:'a'}, {id:'b'}].should.have.ids ['a', 'b'] | ||
['a', 'b'].should.be.ids ['a', 'b'] | ||
[{id:'a'}, {id:'b'}].should.have.same.ids [{id:'a'}, {id:'b'}] | ||
@@ -35,3 +37,9 @@ [{id:'a'}, {id:'b'}].should.not.have.same.ids [{id:'b'}, {id:'a'}] | ||
Works well with [MongoDB ObjectIds](https://github.com/mongodb/node-mongodb-native). | ||
Works well with [MongoDB ObjectIds](https://github.com/mongodb/node-mongodb-native): | ||
```js | ||
doc.should.have.id(new ObjectId()) | ||
doc.should.have.same.id(otherDoc) | ||
(new ObjectId()).should.id(doc) | ||
``` | ||
#### Installation | ||
@@ -38,0 +46,0 @@ |
4305
59