-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathjest.config.js
More file actions
60 lines (59 loc) · 1.6 KB
/
jest.config.js
File metadata and controls
60 lines (59 loc) · 1.6 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const defaultConfig = {
testEnvironment: 'node',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.(ts|js)?$': [
'@swc/jest',
{
jsc: {
target: 'esnext',
parser: { decorators: true, syntax: 'typescript' },
},
},
],
},
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/out/'],
testMatch: ['**/?(*.)+(spec|test).ts'],
extensionsToTreatAsEsm: ['.ts', '.tsx'],
};
/** @type {import('@jest/types').Config.InitialOptions} */
export default {
projects: [
{
...defaultConfig,
displayName: 'apex-log-parser',
rootDir: '<rootDir>/apex-log-parser',
},
{
...defaultConfig,
displayName: 'log-viewer',
rootDir: '<rootDir>/log-viewer',
moduleNameMapper: {
...defaultConfig.moduleNameMapper,
'^apex-log-parser$': '<rootDir>/../apex-log-parser/src/index.ts',
},
transformIgnorePatterns: [
// allow transformation of pixi.js and its dependencies
'<rootDir>/node_modules/(?!pixi\\.js)',
],
},
{
...defaultConfig,
displayName: 'lana',
rootDir: '<rootDir>/lana',
setupFilesAfterEnv: ['<rootDir>/src/__tests__/setup.ts'],
moduleNameMapper: {
...defaultConfig.moduleNameMapper,
'^vscode$': '<rootDir>/src/__tests__/mocks/vscode.ts',
'^apex-log-parser$': '<rootDir>/../apex-log-parser/src/index.ts',
},
transformIgnorePatterns: [
// allow lit/@lit transformation
'<rootDir>/node_modules/(?!@?lit)',
],
},
],
slowTestThreshold: 1,
};