-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
47 lines (46 loc) · 1.24 KB
/
jest.config.js
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
import { before } from 'node:test';
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
preset: 'ts-jest/presets/js-with-ts-esm',
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts'],
transform: {
'^.+\\.[jt]s$': [
'ts-jest',
{
useESM: true,
supportsDynamicImport: true,
tsconfig: 'tsconfig.json',
diagnostics: {
ignoreCodes: [1343, 'TS2821'],
},
astTransformers: {
before: [
{
path: 'node_modules/ts-jest-mock-import-meta',
},
],
},
},
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
modulePathIgnorePatterns: ['<rootDir>/dist/'],
extensionsToTreatAsEsm: ['.ts'],
transformIgnorePatterns: [
'node_modules/(?!@nosana|ora|cli-cursor|restore-cursor|log-symbols|is-unicode-supported|strip-ansi|ansi-regex|string-width|get-east-asian-width|is-interactive|stdin-discarder|lowdb|steno|chalk/.*)',
],
collectCoverageFrom: ['src/**/*.ts'],
coverageReporters: ['text', 'text-summary'],
coveragePathIgnorePatterns: ['src/types/*'],
coverageThreshold: {
global: {
statements: 0,
branches: 0,
lines: 0,
functions: 0,
},
},
};