-
Notifications
You must be signed in to change notification settings - Fork 13
/
jest.config.ts
38 lines (30 loc) · 986 Bytes
/
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
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
import type { JestConfigWithTsJest } from 'ts-jest';
const config: JestConfigWithTsJest = {
// All test files are in src/, so limit Jest to searching for tests there.
rootDir: 'src',
// TypeScript files must first be transformed to JS for testing.
transform: {
'\\.ts$': ['ts-jest', { useESM: true }]
},
// Jest doesn't like importing TypeScript files including the ".js" suffix, so
// remove it.
moduleNameMapper: {
'(.+)\\.js': '$1'
},
// Treat all TypeScript files as ECMAScript modules.
extensionsToTreatAsEsm: ['.ts'],
// The glob patterns Jest uses to detect test files
testMatch: [
"**/?(*.)+(spec|test).ts"
],
// An array of regexp pattern strings that are matched against all test
// paths, matched tests are skipped
testPathIgnorePatterns: [
"/node_modules/"
],
}
export default config;