diff options
Diffstat (limited to 'config/jest.config.base.js')
-rw-r--r-- | config/jest.config.base.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/config/jest.config.base.js b/config/jest.config.base.js new file mode 100644 index 0000000..f265c1c --- /dev/null +++ b/config/jest.config.base.js | |||
@@ -0,0 +1,26 @@ | |||
1 | import { join } from 'path'; | ||
2 | |||
3 | import { fileURLToDirname } from './utils.js'; | ||
4 | |||
5 | const dirname = fileURLToDirname(import.meta.url); | ||
6 | |||
7 | /** @type {import('ts-jest').InitialOptionsTsJest} */ | ||
8 | export default { | ||
9 | preset: 'ts-jest/presets/default-esm', | ||
10 | globals: { | ||
11 | 'ts-jest': { | ||
12 | useESM: true, | ||
13 | }, | ||
14 | }, | ||
15 | moduleNameMapper: { | ||
16 | '@sophie/(.+)': join(dirname, '../packages/$1/src/index.ts'), | ||
17 | '^(\\.{1,2}/.*)\\.js$': '$1', | ||
18 | }, | ||
19 | resetMocks: true, | ||
20 | restoreMocks: true, | ||
21 | testEnvironment: 'node', | ||
22 | testPathIgnorePatterns: [ | ||
23 | '/dist/', | ||
24 | '/node_modules/', | ||
25 | ], | ||
26 | }; | ||