-
Notifications
You must be signed in to change notification settings - Fork 49
/
jest.config.js
44 lines (42 loc) · 1.46 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
const ignoredModules = ['simplebar'];
const baseConfig = {
preset: 'ts-jest/presets/js-with-ts',
modulePathIgnorePatterns: ['dist'],
globalSetup: './packages/globalSetup.ts',
globals: {
'ts-jest': {
babelConfig: {
plugins: [
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
],
},
},
},
moduleNameMapper: {
'@alfalab/core-components-(.*)/(.*)$': '<rootDir>/packages/$1/src/$2',
'@alfalab/core-components-(.*)$': '<rootDir>/packages/$1/src',
'\\.css$': 'identity-obj-proxy',
},
testPathIgnorePatterns: ['codemod'],
transformIgnorePatterns: [`node_modules/(?!${ignoredModules.join('|')})`],
}
module.exports = {
projects: [
{
...baseConfig,
displayName: 'csr', /* client side rendering */
testEnvironment: 'jest-environment-jsdom-sixteen',
setupFilesAfterEnv: ['./packages/setupTests.ts'],
testMatch: ['**/*.test.ts?(x)', '!**/*.(screenshots|ssr).test.ts?(x)'],
coveragePathIgnorePatterns: ['index.ts'],
coverageReporters: ['lcov', 'text', 'text-summary', 'clover'],
},
{
...baseConfig,
displayName: 'ssr', /* server side rendering */
testEnvironment: 'node',
testMatch: ['**/*.ssr.test.ts?(x)'],
}
],
};