Exclude keys to compare from a deep equal operation with chai expect or assert.
MIT License
Bot releases are hidden (Show)
Published by mesaugat 3 months ago
chai-exclude
is now an ESM packagePublished by mesaugat about 3 years ago
Published by mesaugat over 3 years ago
eql
and eqls
Published by mesaugat over 5 years ago
standard
to latest version ^13.0.2lodash
to latest version ^4.17.14Published by mesaugat over 5 years ago
Published by mesaugat over 5 years ago
Breaking Change:
import chaiExclude from 'chai-exclude'
in TypeScript is possible starting v2.0.0
Published by mesaugat almost 6 years ago
Published by mesaugat almost 6 years ago
keyof
for checking excluded property names (#16)Published by mesaugat about 6 years ago
Published by mesaugat about 6 years ago
Published by mesaugat over 6 years ago
isObject
to work with classes (#12)Published by mesaugat over 6 years ago
assert.deepEqualExcluding
and assert.deepEqualExcludingEvery
declarations (#11)Published by mesaugat over 6 years ago
excluding
and excludingEvery
(#10)/**
* @param { T } actual
* @param { T } expected
* @param { string | string[] } excluding
* @param { string } message
*/
assert.deepEqualExcluding(actual, expected, excluding, [message])
assert.deepEqualExcludingEvery(actual, expected, excluding, [message])
Published by mesaugat almost 7 years ago
expect([{ a: 'a', b: 'b' }]).excluding('a').to.deep.equal([{ b: 'b' }])
Published by mesaugat almost 7 years ago
Published by mesaugat almost 7 years ago
excluding
and excludingEvery
will now exclude keys from both sidesThese two examples are the same.
expect({ a: 'a', b: 'b' }).excluding('a').to.deep.equal({ b: 'b' })
expect({ a: 'a', b: 'b' }).excluding('a').to.deep.equal({ a: 'z', b: 'b' });
Published by mesaugat almost 7 years ago
excluding
before a deep equal comparisonPublished by mesaugat almost 7 years ago
Published by mesaugat almost 7 years ago
excludingEvery
Note: The TypeScript bindings for v1.0.1
might not work. Please upgrade to v1.0.2