Skip to content

Commit

Permalink
Added test csase for regex
Browse files Browse the repository at this point in the history
  • Loading branch information
dictor93 committed Nov 27, 2023
1 parent 559ccd4 commit 9dbf5e6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/isEqual.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,14 @@ describe('isEqual', () => {

assert.ok(isEqual(arr1, arr2))
})

it('should compare regexes', () => {
assert.ok(isEqual(/asd/gim, /asd/gim))
assert.ok(!isEqual(/asd/gi, /asd/g))
assert.ok(!isEqual(/asd/, /asf/))
assert.strictEqual(
isEqual(/x/g, { global: true, ignoreCase: false, multiline: false, source: 'x' }),
false
)
})
})

0 comments on commit 9dbf5e6

Please sign in to comment.