-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
- Loading branch information
1 parent
a9b18c7
commit 4103f94
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* @file Unit Tests - MODULES_REGEX | ||
* @module estree-util-unassert/utils/tests/unit/MODULES_REGEX | ||
*/ | ||
|
||
import TEST_SUBJECT from '../modules-regex' | ||
|
||
describe('unit:utils/MODULES_REGEX', () => { | ||
beforeEach(() => { | ||
TEST_SUBJECT.lastIndex = 0 | ||
}) | ||
|
||
it('should match "assert"', () => { | ||
expect(TEST_SUBJECT.test('assert')).to.be.true | ||
}) | ||
|
||
it('should match "devlop"', () => { | ||
expect(TEST_SUBJECT.test('devlop')).to.be.true | ||
}) | ||
|
||
it('should match "node:assert"', () => { | ||
expect(TEST_SUBJECT.test('node:assert')).to.be.true | ||
}) | ||
|
||
it('should match "node:assert/strict"', () => { | ||
expect(TEST_SUBJECT.test('node:assert/strict')).to.be.true | ||
}) | ||
|
||
it('should match "power-assert"', () => { | ||
expect(TEST_SUBJECT.test('power-assert')).to.be.true | ||
}) | ||
|
||
it('should match "uvu/assert"', () => { | ||
expect(TEST_SUBJECT.test('uvu/assert')).to.be.true | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* @file Entry Point - Utilities | ||
* @module estree-util-unassert/utils | ||
*/ | ||
|
||
export { default as MODULES_REGEX } from './modules-regex' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* @file Utilities - MODULES_REGEX | ||
* @module estree-util-unassert/utils/MODULES_REGEX | ||
*/ | ||
|
||
/** | ||
* Default regular expression used to match assertion module ids. | ||
* | ||
* @const {RegExp} MODULES_REGEX | ||
*/ | ||
const MODULES_REGEX: RegExp = | ||
/^(?:(?:(?:power-)|(?:uvu\/))?assert|devlop|(?:node:)?assert(?:\/strict)?)$/ | ||
|
||
export default MODULES_REGEX |