chai-things

Chai Things adds support to [Chai](http://chaijs.com/) for assertions on array elements.

5 个版本
安装
npm install chai-things
yarn add chai-things
pnpm add chai-things
bun add chai-things
README

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'));
版本列表
0.2.0 2013-04-05
0.1.2 2013-03-25
0.1.1 2013-01-09
0.1.0 2013-01-09
0.0.1 2013-01-08