theatre/jest.config.js
Aria 718beb4d7b
Catch more SSR issues and improve compat tests (#353)
This will cause the build to fail, as this will catch an SSR issue, which will be fixed after merging #369
2023-01-04 20:03:47 +01:00

36 lines
1 KiB
JavaScript

/** @type {import('jest').Config} */
module.exports = {
testMatch: [
'<rootDir>/packages/*/src/**/*.test.ts',
'<rootDir>/theatre/*/src/**/*.test.ts',
],
moduleNameMapper: {
...require('./devEnv/getAliasesFromTsConfig').getAliasesFromTsConfigForJest(),
'\\.(css|svg|png)$': 'identity-obj-proxy',
'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',
'react-icons/(.*)': 'identity-obj-proxy',
},
setupFiles: ['./theatre/shared/src/setupTestEnv.ts'],
automock: false,
transform: {
'^.+\\.tsx?$': [
'esbuild-jest',
{
sourcemap: true,
},
],
'^.+\\.js$': [
'esbuild-jest',
{
sourcemap: true,
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
}