generated from lawalletio/module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.cjs
48 lines (48 loc) · 1.29 KB
/
jest.config.cjs
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
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
coveragePathIgnorePatterns: ['<rootDir>/src/index.ts', '\\.test\\.ts'],
coverageDirectory: '<rootDir>/dist/.coverage',
coverageProvider: 'babel',
extensionsToTreatAsEsm: ['.ts'],
logHeapUsage: true,
passWithNoTests: true,
// preset: 'ts-jest',
randomize: true,
resetModules: true,
restoreMocks: false,
rootDir: '.',
setupFiles: ['dotenv/config'],
testEnvironment: 'node',
testMatch: ['<rootDir>/tests/**/*.test.ts'],
transform: {
'\\.ts': [
'ts-jest',
{
diagnostics: {
ignoreCodes: [1343],
},
astTransformers: {
before: [
{
path: 'ts-jest-mock-import-meta',
},
],
},
},
],
},
maxWorkers: 1,
moduleNameMapper: {
'^@constants/(.*)$': '<rootDir>/src/constants/$1',
'^@lib/(.*)$': '<rootDir>/src/lib/$1',
'^@mocks/(.*)$': '<rootDir>/__mocks__/$1',
'^@nostr/(.*)$': '<rootDir>/src/nostr/$1',
'^@rest/(.*)$': '<rootDir>/src/rest/$1',
'^@services/(.*)$': '<rootDir>/src/services/$1',
'^@src/(.*)$': '<rootDir>/src/$1',
'^@type/(.*)$': '<rootDir>/src/type/$1',
},
};