1.0.1 • Published 6 years ago

chai-any-eql v1.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

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});
1.0.1

6 years ago

1.0.0

6 years ago