forked from hc-tcg/hc-tcg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.mjs
38 lines (32 loc) · 1.05 KB
/
jest.config.mjs
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
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
/** @type {import('ts-jest').JestConfigWithTsJest} */
const config = {
// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'ts', 'json'],
roots: ['tests/unit/', 'tests/db', 'tests/replays'],
moduleNameMapper: {
'^client/(.*)$': '<rootDir>/client/src/$1',
// Deal with weird imports in the client.
'^components/(.*)$': '<rootDir>/client/src/components/$1',
'^logic/(.*)$': '<rootDir>/client/src/logic/$1',
'^common/(.*)$': '<rootDir>/common/$1',
'^server/(.*)$': '<rootDir>/server/src/$1',
'^.+\\.css$': ['jest-scss-transform', {modules: true}],
'^.+\\.scss$': ['jest-scss-transform', {modules: true}],
},
// A map from regular expressions to paths to transformers
transform: {
'^.+\\.[jt]sx?$': [
'ts-jest',
{
diagnostics: false,
tsconfig: 'tests/unit/tsconfig.json',
},
],
},
}
export default config