diff options
Diffstat (limited to 'config/jest.config.base.cjs')
-rw-r--r-- | config/jest.config.base.cjs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/config/jest.config.base.cjs b/config/jest.config.base.cjs new file mode 100644 index 0000000..ee85d66 --- /dev/null +++ b/config/jest.config.base.cjs | |||
@@ -0,0 +1,27 @@ | |||
1 | const path = require('node:path'); | ||
2 | |||
3 | /** @type {import('@jest/types').Config.InitialOptions} */ | ||
4 | module.exports = { | ||
5 | transform: { | ||
6 | '\\.[jt]sx?$': path.join(__dirname, 'jestEsbuildCjsTransformer.cjs'), | ||
7 | }, | ||
8 | testRegex: '(\\.|/)integ\\.spec\\.ts$', | ||
9 | transformIgnorePatterns: ['/node_modules/(?!(chalk|lodash-es)/)'], | ||
10 | moduleNameMapper: { | ||
11 | '^@sophie/(.+)$': path.join(__dirname, '../packages/$1/src/index.ts'), | ||
12 | '^(\\.{1,2}/.*)\\.jsx?$': '$1', | ||
13 | // Workaround for jest to recognize the vendored dependencies of chalk. | ||
14 | '^#ansi-styles$': path.join( | ||
15 | __dirname, | ||
16 | '../node_modules/chalk/source/vendor/ansi-styles/index.js', | ||
17 | ), | ||
18 | '^#supports-color$': path.join( | ||
19 | __dirname, | ||
20 | '../node_modules/chalk/source/vendor/supports-color/index.js', | ||
21 | ), | ||
22 | }, | ||
23 | resetMocks: true, | ||
24 | restoreMocks: true, | ||
25 | testEnvironment: 'node', | ||
26 | testPathIgnorePatterns: ['/dist/', '/node_modules/'], | ||
27 | }; | ||