diff options
Diffstat (limited to 'jest.config.js')
-rw-r--r-- | jest.config.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/jest.config.js b/jest.config.js index eda029a..1aa0cbb 100644 --- a/jest.config.js +++ b/jest.config.js | |||
@@ -1,17 +1,21 @@ | |||
1 | // @ts-check | 1 | import { join } from 'path'; |
2 | 2 | ||
3 | const { join } = require('path'); | 3 | import { fileURLToDirname } from './config/build-common.js'; |
4 | |||
5 | const dirname = fileURLToDirname(import.meta.url); | ||
4 | 6 | ||
5 | /** @type {import('ts-jest').InitialOptionsTsJest} */ | 7 | /** @type {import('ts-jest').InitialOptionsTsJest} */ |
6 | module.exports = { | 8 | export default { |
7 | preset: 'ts-jest', | 9 | preset: 'ts-jest/presets/default-esm', |
8 | globals: { | 10 | globals: { |
9 | 'ts-jest': { | 11 | 'ts-jest': { |
10 | isolatedModules: true, | 12 | isolatedModules: true, |
13 | useESM: true, | ||
11 | }, | 14 | }, |
12 | }, | 15 | }, |
13 | moduleNameMapper: { | 16 | moduleNameMapper: { |
14 | '@sophie/(.+)': join(__dirname, 'packages/$1/src/index.ts'), | 17 | '@sophie/(.+)': join(dirname, 'packages/$1/src/index.ts'), |
18 | '^(\\.{1,2}/.*)\\.js$': '$1', | ||
15 | }, | 19 | }, |
16 | resetMocks: true, | 20 | resetMocks: true, |
17 | restoreMocks: true, | 21 | restoreMocks: true, |