-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improve assert test coverage (#142)
* feature: add testes in assert * feature: add testes in assert promisse * add tests * feature: finalize tests in assert * feature: format * fix: fix lint * fix: fix version helper * fix: adjust test rejects * fix: adjust test promisse * fix: adjust rejects node 10 or higher * fix: adjust rejects node 10 or higher * fix: adjust doesNotReject node 10 or higher * fix: organize assert.test.ts * fix: node 8 assert throw * fix: adjust function callback
- Loading branch information
Showing
4 changed files
with
396 additions
and
13 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,17 @@ | ||
import process from 'node:process'; | ||
|
||
const getVersionNumber = () => { | ||
const versionMatch = process.version.match(/^v(\d+)/); | ||
return versionMatch ? parseInt(versionMatch[1], 10) : 0; | ||
}; | ||
|
||
const version = getVersionNumber(); | ||
|
||
export const isNode12OrHigher = () => version >= 12; | ||
export const isNode14OrHigher = () => version >= 14; | ||
|
||
export const isNode10OrHigher = () => version >= 10; | ||
|
||
export const isNode8OrHigher = () => version >= 8; | ||
|
||
export const supportsESM = () => isNode14OrHigher(); |
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
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
Oops, something went wrong.