theatre/jest.config.js
2022-02-21 13:33:08 +01:00

32 lines
844 B
JavaScript

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',
// An ES module that jest can't handle at the moment.
'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'],
}