forked from RedHatInsights/learning-resources
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
47 lines (45 loc) · 1.16 KB
/
Copy pathjest.config.js
File metadata and controls
47 lines (45 loc) · 1.16 KB
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
const transformIgnorePatterns = ['node_modules/(?!(uuid|yaml)/)'];
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
coverageDirectory: './coverage/',
collectCoverage: true,
collectCoverageFrom: ['src/**/*.js', '!src/**/stories/*'],
roots: ['<rootDir>/src/'],
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy',
'^chrome/(.*)$': '<rootDir>/src/__mocks__/chrome/$1',
},
transformIgnorePatterns,
setupFilesAfterEnv: ['<rootDir>/config/jest.setup.js'],
transform: {
// Setup file: use SWC without plugin (plugin fails on plain .js)
'jest\\.setup\\.js$': [
'@swc/jest',
{
jsc: {
parser: { syntax: 'ecmascript' },
},
},
],
// SWC without jest_workaround plugin (plugin can fail to invoke on some systems)
'^.+\\.(ts|js)x?$': [
'@swc/jest',
{
jsc: {
parser: {
jsx: true,
syntax: 'typescript',
tsx: true,
},
transform: {
react: {
runtime: 'automatic',
},
},
},
},
],
},
};