diff options
Diffstat (limited to 'config/jest.config.base.js')
-rw-r--r-- | config/jest.config.base.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/config/jest.config.base.js b/config/jest.config.base.js index 21f93be..d9865f9 100644 --- a/config/jest.config.base.js +++ b/config/jest.config.base.js | |||
@@ -1,24 +1,24 @@ | |||
1 | import { join } from 'path'; | 1 | import path from 'node:path'; |
2 | 2 | ||
3 | import fileURLToDirname from './fileURLToDirname.js'; | 3 | import fileUrlToDirname from './fileUrlToDirname.js'; |
4 | 4 | ||
5 | const thisDir = fileURLToDirname(import.meta.url); | 5 | const thisDir = fileUrlToDirname(import.meta.url); |
6 | 6 | ||
7 | /** @type {import('@jest/types').Config.InitialOptions} */ | 7 | /** @type {import('@jest/types').Config.InitialOptions} */ |
8 | export default { | 8 | export default { |
9 | transform: { | 9 | transform: { |
10 | '\\.tsx?$': join(thisDir, 'jestEsbuildTransformer.js'), | 10 | '\\.tsx?$': path.join(thisDir, 'jestEsbuildTransformer.js'), |
11 | }, | 11 | }, |
12 | extensionsToTreatAsEsm: ['.ts', '.tsx'], | 12 | extensionsToTreatAsEsm: ['.ts', '.tsx'], |
13 | moduleNameMapper: { | 13 | moduleNameMapper: { |
14 | '^@sophie/(.+)$': join(thisDir, '../packages/$1/src/index.ts'), | 14 | '^@sophie/(.+)$': path.join(thisDir, '../packages/$1/src/index.ts'), |
15 | '^(\\.{1,2}/.*)\\.jsx?$': '$1', | 15 | '^(\\.{1,2}/.*)\\.jsx?$': '$1', |
16 | // Workaround for jest to recognize the vendored dependencies of chalk. | 16 | // Workaround for jest to recognize the vendored dependencies of chalk. |
17 | '^#ansi-styles$': join( | 17 | '^#ansi-styles$': path.join( |
18 | thisDir, | 18 | thisDir, |
19 | '../node_modules/chalk/source/vendor/ansi-styles/index.js', | 19 | '../node_modules/chalk/source/vendor/ansi-styles/index.js', |
20 | ), | 20 | ), |
21 | '^#supports-color$': join( | 21 | '^#supports-color$': path.join( |
22 | thisDir, | 22 | thisDir, |
23 | '../node_modules/chalk/source/vendor/supports-color/index.js', | 23 | '../node_modules/chalk/source/vendor/supports-color/index.js', |
24 | ), | 24 | ), |