chai-any-eql

1.0.1 • Public • Published

chai-any-eql

Build Status Coverage Status

Allows you to wildcard values.

Config

const chai = require('chai');
const chaiAnyEql = require('chai-any-eql');
 
chai.use(chaiAnyEql);

Assertion

// For any item
expect([1, 2, 3]).to.anyEql([1, chai.ANY, 3]);
 
// On any level
expect({foo: 1, bar: 2}).to.anyEql({foo: 1, bar: chai.ANY});
expect([{ foo: { bar: { baz: 1 } } }]).anyEql([{ foo: chai.ANY }]);
expect([{ foo: { bar: { baz: 1 } } }]).anyEql([{ foo: { bar: chai.ANY } }]);
expect([{ foo: { bar: { baz: 1 } } }]).anyEql([{ foo: { bar: { baz: chai.ANY } } }]);

Or

expect(1).to.any.eq(chai.ANY);
expect(2).to.any.equal(chai.ANY);
expect([1, 2, 3]).to.any.eql([1, chai.ANY, 3]);
expect({foo: 1, bar: 2}).to.any.eql({foo: 1, bar: chai.ANY});

Readme

Keywords

Package Sidebar

Install

npm i chai-any-eql

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • ematos