aboutsummaryrefslogtreecommitdiffstats
path: root/config/jest.config.base.js
diff options
context:
space:
mode:
Diffstat (limited to 'config/jest.config.base.js')
-rw-r--r--config/jest.config.base.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/config/jest.config.base.js b/config/jest.config.base.js
index 87d5b31..bc34295 100644
--- a/config/jest.config.base.js
+++ b/config/jest.config.base.js
@@ -4,18 +4,19 @@ import { fileURLToDirname } from './utils.js';
4 4
5const thisDir = fileURLToDirname(import.meta.url); 5const thisDir = fileURLToDirname(import.meta.url);
6 6
7/** @type {import('ts-jest').InitialOptionsTsJest} */ 7/** @type {import('@jest/types').Config.InitialOptions} */
8export default { 8export default {
9 preset: 'ts-jest/presets/default-esm', 9 transform: {
10 globals: { 10 '\\.tsx?$': join(thisDir, 'jestEsbuildTransform.js'),
11 'ts-jest': {
12 useESM: true,
13 },
14 }, 11 },
12 extensionsToTreatAsEsm: [
13 '.ts',
14 '.tsx',
15 ],
15 moduleNameMapper: { 16 moduleNameMapper: {
16 '@sophie/(.+)': join(thisDir, '../packages/$1/src/index.ts'), 17 '@sophie/(.+)': join(thisDir, '../packages/$1/src/index.ts'),
17 '^(\\.{1,2}/.*)\\.js$': '$1', 18 '^(\\.{1,2}/.*)\\.jsx?$': '$1',
18 // Workaround for typescript to recognize the vendored dependencies of chalk. 19 // Workaround for jest to recognize the vendored dependencies of chalk.
19 '#ansi-styles': join(thisDir, '../node_modules/chalk/source/vendor/ansi-styles/index.js'), 20 '#ansi-styles': join(thisDir, '../node_modules/chalk/source/vendor/ansi-styles/index.js'),
20 '#supports-color': join(thisDir, '../node_modules/chalk/source/vendor/supports-color/index.js'), 21 '#supports-color': join(thisDir, '../node_modules/chalk/source/vendor/supports-color/index.js'),
21 }, 22 },