-
-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathjest.config.ts
More file actions
42 lines (38 loc) · 1.25 KB
/
Copy pathjest.config.ts
File metadata and controls
42 lines (38 loc) · 1.25 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
import type { JestConfigWithTsJest } from 'ts-jest'
import { pathsToModuleNameMapper } from 'ts-jest'
import ts from 'typescript'
const tsConfig = ts.readConfigFile('./tsconfig.json', ts.sys.readFile)
const jestConfig: JestConfigWithTsJest = {
workerIdleMemoryLimit: '256',
preset: 'ts-jest/presets/default-esm',
verbose: false,
testTimeout: 5000,
testMatch: [
'**/__tests__/**/*.[jt]s?(x)',
'**/?(*.)(spec|test).mjs',
'**/?(*.)+(spec|test).[jt]s?(x)',
],
testPathIgnorePatterns: ['webpac', 'eslint-rules', '.github', 'e2e'],
transform: {
'\\.m?[jt]sx?$': [
'ts-jest',
{
useESM: true,
},
],
},
transformIgnorePatterns: ['/!node_modules\\/@faker-js\\/faker/'],
setupFiles: ['fake-indexeddb/auto', 'jest-webextension-mock'],
setupFilesAfterEnv: ['./jest.setup.ts', 'jest-extended/all'],
roots: ['<rootDir>'],
moduleNameMapper: {
...pathsToModuleNameMapper(tsConfig.config.compilerOptions.paths, {
useESM: true,
prefix: '<rootDir>/',
}),
'#monitor': '<rootDir>/src/monitors/console.ts',
},
coveragePathIgnorePatterns: ['.mock.ts', '.mock.js', 'mocks', 'utils/test/*'],
coverageReporters: ['clover', 'json', 'lcov', ['text', { skipFull: true }]],
}
export default jestConfig