-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
33 lines (26 loc) · 1.1 KB
/
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
import { resolve } from "path";
import type { Config } from "@jest/types";
const config: Config.InitialOptions = {
verbose: true,
testMatch: ['**/packages/**/test/?(*[-.])+(spec|test).[jt]s?(x)'],
// Maps a regular expression for a "path" and maps it to a transformer
// https://jestjs.io/docs/en/configuration#transform-objectstring-pathtotransformer--pathtotransformer-object
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
// https://jestjs.io/docs/en/configuration#transformignorepatterns-arraystring
transformIgnorePatterns: [
// "<rootDir>/node_modules/(?!(universal-fire|@forest-fire)).+\\.js$",
resolve(process.cwd(), 'node_modules') +
`/(?!(universal-fire|@forest-fire)).+\\.js$`,
],
// modules which do NOT export CJS must have an entry to
// https://jestjs.io/docs/en/configuration#modulenamemapper-objectstring-string--arraystring
moduleNameMapper: {
'^@/(.*)$': resolve(process.cwd(), 'src', '$1'),
},
// adds more assertions to the default library that Jest provides
setupFilesAfterEnv: ['jest-extended'],
testEnvironment: 'node',
};
export default config;