-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor Jest configuration to allow
verbatimModuleSyntax
(#32)
- Loading branch information
1 parent
bd1a230
commit ceb328a
Showing
5 changed files
with
19 additions
and
20 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
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 |
---|---|---|
@@ -1,11 +1,17 @@ | ||
import { JestConfigWithTsJest } from 'ts-jest'; | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
const jestConfig: JestConfigWithTsJest = { | ||
preset: 'ts-jest/presets/default-esm', // or other ESM presets | ||
extensionsToTreatAsEsm: ['.ts'], | ||
moduleNameMapper: { '^(\\.{1,2}/.*)\\.js$': '$1' }, | ||
transform: { | ||
'^.+\\.m?[t]sx?$': ['ts-jest', { | ||
isolatedModules: true, | ||
useESM: true | ||
}], | ||
}, | ||
testEnvironment: 'node', | ||
testMatch: ['<rootDir>/**/test/*.ts', '<rootDir>/**/test/types/*.ts'], | ||
collectCoverageFrom: ['src/**'], | ||
}; | ||
|
||
export default jestConfig; | ||
export = jestConfig; |
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