-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
executable file
·36 lines (35 loc) · 1013 Bytes
/
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
// hide error messages about act() being unsupported in production build
const ignoredErrors = [
/act(...) is not supported in production builds of React, and might not behave as expected./,
];
const consoleError = global.console.error;
global.console.error = (...args) => {
if (ignoredErrors.some((el) => el.test(args[0]))) {
return consoleError(...args);
}
};
module.exports = {
projects: [
{
preset: 'ts-jest',
displayName: 'dom',
testEnvironment: 'jsdom',
testMatch: ['**/*.test.tsx'],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }],
},
transformIgnorePatterns: ['/node_modules/'],
moduleNameMapper: {
'^.+\\.(css|less|scss)$': 'identity-obj-proxy',
'^.+\\.module\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
},
{
preset: 'ts-jest',
displayName: 'node',
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
},
],
verbose: true,
};