theatre/jest.config.js

46 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

/** @type {import('jest').Config} */
2021-06-18 13:05:06 +02:00
module.exports = {
testMatch: [
'<rootDir>/packages/*/src/**/*.test.ts',
'<rootDir>/theatre/*/src/**/*.test.ts',
2023-08-07 12:18:14 +02:00
'<rootDir>/theatre/*/src/**/*.test.ts',
'<rootDir>/devEnv/**/*.test.ts',
2021-06-18 13:05:06 +02:00
],
moduleNameMapper: {
2021-06-18 14:32:01 +02:00
...require('./devEnv/getAliasesFromTsConfig').getAliasesFromTsConfigForJest(),
2021-08-08 10:16:33 +02:00
'\\.(css|svg|png)$': 'identity-obj-proxy',
2021-06-18 13:05:06 +02:00
'lodash-es/(.*)': 'lodash/$1',
'react-use/esm/(.*)': 'react-use/lib/$1',
'lodash-es': 'lodash',
// ES modules that jest can't handle at the moment.
uuid: '<rootDir>/node_modules/uuid/dist/index.js',
nanoid: '<rootDir>/node_modules/nanoid/index.cjs',
'nanoid/non-secure': '<rootDir>/node_modules/nanoid/non-secure/index.cjs',
2021-07-14 19:08:25 +02:00
'react-icons/(.*)': 'identity-obj-proxy',
2023-08-07 12:18:14 +02:00
'react-merge-refs': 'identity-obj-proxy',
2021-06-18 13:05:06 +02:00
},
setupFiles: ['./theatre/shared/src/setupTestEnv.ts'],
automock: false,
transform: {
2022-02-21 13:33:08 +01:00
'^.+\\.tsx?$': [
2023-07-16 22:19:21 +02:00
'jest-esbuild',
2022-02-21 13:33:08 +01:00
{
sourcemap: true,
2023-07-16 22:19:21 +02:00
supported: {
'dynamic-import': false,
},
2022-02-21 13:33:08 +01:00
},
],
'^.+\\.js$': [
2023-07-16 22:19:21 +02:00
'jest-esbuild',
2022-02-21 13:33:08 +01:00
{
sourcemap: true,
2023-07-16 22:19:21 +02:00
supported: {
'dynamic-import': false,
},
2022-02-21 13:33:08 +01:00
},
],
2021-06-18 13:05:06 +02:00
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
}