Skip to content

Commit

Permalink
feat: adds deepStrictEqual to Chai Assert list
Browse files Browse the repository at this point in the history
  • Loading branch information
abnersajr committed Jul 20, 2022
1 parent de5ab1b commit 57f17c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transformers/chai-assert.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ describe('Mapping Test', () => {
['assert.notStrictEqual(foo, bar, baz);', 'expect(foo).not.toBe(bar);'],
['assert.deepEqual(foo, bar, baz);', 'expect(foo).toEqual(bar);'],
['assert.notDeepEqual(foo, bar, baz);', 'expect(foo).not.toEqual(bar);'],
['assert.deepStrictEqual(foo, bar, baz);', 'expect(foo).toStrictEqual(bar);'],
['assert.notDeepStrictEqual(foo, bar, baz);', 'expect(foo).not.toStrictEqual(bar);'],
['assert.isAbove(foo, bar, baz);', 'expect(foo).toBeGreaterThan(bar);'],
['assert.isAtLeast(foo, bar, baz);', 'expect(foo).toBeGreaterThanOrEqual(bar);'],
['assert.isBelow(foo, bar, baz);', 'expect(foo).toBeLessThan(bar);'],
Expand Down
5 changes: 5 additions & 0 deletions src/transformers/chai-assert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ const assertToExpectMapping = [
expect: 'toEqual',
includeNegative: 'notDeepEqual',
},
{
assert: 'deepStrictEqual',
expect: 'toStrictEqual',
includeNegative: 'notDeepStrictEqual',
},
{
assert: 'isAbove',
expect: 'toBeGreaterThan',
Expand Down

0 comments on commit 57f17c2

Please sign in to comment.