chai-things
Chai Things adds support to [Chai](http://chaijs.com/) for assertions on array elements.
Last updated 13 years ago by rubenverborgh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install chai-things 
SYNC missed versions from official npm registry.

Chai Things

Chai Things adds support to Chai for assertions on array elements.

Example

// Although they are equal, two different { a: 1 } objects are not the same
[{ a: 1 }, { b: 2 }].should.not.include({ a: 1 })
// However, Chai Things allows us to test what we want
[{ a: 1 }, { b: 2 }].should.include.something.that.deep.equals({ b: 2 })
// If the test fails, we get a descriptive message
[{ a: 1 }, { b: 2 }].should.include.something.that.deep.equals({ c: 3 })
/* expected an element of [ { a: 1 }, { b: 2 } ] to deeply equal { c: 3 } */

Installation and usage

$ npm install chai-things
var chai = require("chai");
chai.should();
chai.use(require('chai-things'));

Current Tags

  • 0.2.0                                ...           latest (13 years ago)

5 Versions

  • 0.2.0                                ...           13 years ago
  • 0.1.2                                ...           13 years ago
  • 0.1.1                                ...           13 years ago
  • 0.1.0                                ...           13 years ago
  • 0.0.1                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (4)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org | Home |