-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
69 lines (66 loc) · 1.75 KB
/
jest.config.ts
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
61
62
63
64
65
66
67
68
69
const modulePathIgnorePatterns = [
'<rootDir>/packages/skchain/dist',
'<rootDir>/packages/contract_builder/dist',
];
const transform = {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.json',
useESM: true,
},
],
};
/** @type {import('jest').Config} */
const config = {
maxConcurrency: 1,
maxWorkers: 1,
automock: true,
resetMocks: true,
resetModules: true,
testTimeout: 120000,
projects: [
{
displayName: 'skchain',
preset: 'ts-jest/presets/default-esm',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform,
testMatch: [
'<rootDir>/packages/skchain/tests/**/?(*.)+(spec|test).[jt]s?(x)',
'<rootDir>/packages/skchain/src/**/__tests__/**/?(*.)+(spec|test).[jt]s?(x)',
'<rootDir>/packages/contract/tests/**/?(*.)+(spec|test).[jt]s?(x)',
],
modulePathIgnorePatterns,
},
{
globalSetup: '<rootDir>/packages/sknode/tests/setup.mjs',
globalTeardown: '<rootDir>/packages/sknode/tests/teardown.mjs',
displayName: 'sknode',
preset: 'ts-jest/presets/default-esm',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform,
testMatch: [
'<rootDir>/packages/sknode/tests/**/?(*.)+(spec|test).[jt]s?(x)',
],
modulePathIgnorePatterns,
},
{
displayName: 'common',
preset: 'ts-jest/presets/default-esm',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform,
testMatch: [
'<rootDir>/packages/common/tests/**/?(*.)+(spec|test).[jt]s?(x)',
'<rootDir>/packages/common/src/**/__tests__/**/?(*.)+(spec|test).[jt]s?(x)',
],
modulePathIgnorePatterns,
},
],
};
module.exports = config;