-
Notifications
You must be signed in to change notification settings - Fork 364
/
jest.config.js
47 lines (47 loc) · 1.33 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/** @type {import('jest').Config} */
module.exports = {
testMatch: [
'<rootDir>/packages/*/src/**/*.test.ts',
'<rootDir>/devEnv/**/*.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',
'react-merge-refs': 'identity-obj-proxy',
'@trpc/client': 'identity-obj-proxy',
oauth4webapi: 'identity-obj-proxy',
},
setupFiles: [
'./packages/studio/src/integration-tests/setupIntegrationTestEnv.ts',
],
automock: false,
transform: {
'^.+\\.tsx?$': [
'jest-esbuild',
{
sourcemap: true,
supported: {
'dynamic-import': false,
},
},
],
'^.+\\.js$': [
'jest-esbuild',
{
sourcemap: true,
supported: {
'dynamic-import': false,
},
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
}