Skip to content

eduardo-matos/chai-any-eql

Repository files navigation

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

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published