-
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.
- Loading branch information
1 parent
9625c39
commit 5f318a4
Showing
8 changed files
with
8,067 additions
and
2,040 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
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,18 @@ | ||
// @ts-nocheck | ||
|
||
const mjsResolver = (path, options) => { | ||
const mjsExtRegex = /\.mjs$/i; | ||
const resolver = options.defaultResolver; | ||
|
||
if (mjsExtRegex.test(path)) { | ||
try { | ||
return resolver(path.replace(mjsExtRegex, '.mts'), options); | ||
} catch { | ||
// use default resolver | ||
} | ||
} | ||
|
||
return resolver(path, options); | ||
}; | ||
|
||
module.exports = mjsResolver; |
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,18 @@ | ||
import type { InitialOptionsTsJest } from 'ts-jest'; | ||
|
||
const configuration: InitialOptionsTsJest = { | ||
extensionsToTreatAsEsm: ['.ts', '.mts'], | ||
moduleFileExtensions: ['js', 'ts', 'tsx', 'mts'], | ||
resolver: '<rootDir>/jest-mjs-resolver.ts', | ||
testMatch: ['**/*.spec.mts'], | ||
transform: { | ||
'^.+\\.m?tsx?$': [ | ||
'ts-jest', | ||
{ | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
export default configuration; |
Oops, something went wrong.