Skip to content

Commit

Permalink
Override include method - update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrboj committed Oct 30, 2023
1 parent 68e63cd commit 96c1aaa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions chai-exclude.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ describe('chai-exclude', () => {

it('should also exclude a key from the other object', () => {
expect({ a: 'a', b: 'b', c: 'c' }).excluding('a').to.deep.equal({ a: 'z', b: 'b', c: 'c' })
expect({ a: 'a', b: 'b', c: 'c' }).excluding('a').to.deep.include({ a: 'z', b: 'b', c: 'c' })
})

it('should also exclude a key from the other object and contain alias is used', () => {
expect({ a: 'a', b: 'b', c: 'c' }).excluding('a').to.deep.contain({ a: 'z', b: 'b', c: 'c' })
})

it('should exclude an array of keys from the object', () => {
Expand Down Expand Up @@ -327,6 +332,7 @@ describe('chai-exclude', () => {
expectedObj.e = expectedObj

expect(initialObj).excluding('a').to.deep.equal(expectedObj)
expect(initialObj).excluding('a').to.deep.include(expectedObj)
})
})

Expand Down Expand Up @@ -368,6 +374,7 @@ describe('chai-exclude', () => {
}

expect(initialObj).excludingEvery('a').to.deep.equal(expectedObj)
expect(initialObj).excludingEvery('a').to.deep.include(expectedObj)
})

it('should exclude a key from multiple levels of a given object when value is not an object', () => {
Expand Down

0 comments on commit 96c1aaa

Please sign in to comment.