-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathjest.config.js
More file actions
52 lines (50 loc) · 1.55 KB
/
jest.config.js
File metadata and controls
52 lines (50 loc) · 1.55 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
process.env.TZ = 'UTC';
process.env.NODE_OPTIONS = [
process.env.NODE_OPTIONS,
// https://jestjs.io/docs/ecmascript-modules
`--experimental-vm-modules`,
]
.filter(Boolean)
.join(' ');
/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
setupFilesAfterEnv: ['./__tests__/setup.ts'],
globalTeardown: './__tests__/teardown.ts',
testPathIgnorePatterns: [
'<rootDir>/__tests__/setup.ts',
'<rootDir>/__tests__/teardown.ts',
'<rootDir>/__tests__/.*/helpers.ts',
'<rootDir>/__tests__/helpers.ts',
'<rootDir>/__tests__/fixture/',
],
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
},
workerIdleMemoryLimit: '2048MB',
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
// do not report type checking errors when running tests
// those are visible on build and inside code editor
diagnostics: {
exclude: ['**'],
},
},
],
},
moduleNameMapper: {
'^file-type$': '<rootDir>/node_modules/file-type/index.js',
'^jose$': '<rootDir>/__mocks__/jose.ts',
'^isomorphic-dompurify$': '<rootDir>/__mocks__/isomorphic-dompurify.ts',
'^better-auth$': '<rootDir>/__mocks__/better-auth.ts',
'^better-auth/api$': '<rootDir>/__mocks__/better-auth-api.ts',
'^better-auth/node$': '<rootDir>/__mocks__/better-auth-node.ts',
'^better-auth/plugins$': '<rootDir>/__mocks__/better-auth-plugins.ts',
'^better-auth/plugins/email-otp$':
'<rootDir>/__mocks__/better-auth-plugins-email-otp.ts',
},
};