forked from onlyhom/mobile-select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
27 lines (24 loc) · 826 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
import type { Config } from "@jest/types";
const config: Config.InitialOptions = {
clearMocks: true,
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}", "!src/**/*.d.ts"],
coverageDirectory: "coverage",
moduleDirectories: ["node_modules", "src"],
moduleFileExtensions: ["js", "jsx", "ts", "tsx"],
bail: true,
setupFilesAfterEnv: ["@testing-library/jest-dom"],
testEnvironment: "jsdom",
testMatch: ["**/?(*.)+(spec|test).[tj]s?(x)"],
transformIgnorePatterns: ["/node_modules/"],
preset: "ts-jest",
transform: {
"^.+\\.(ts|tsx)$": "ts-jest",
"\\.(less|css)$": "jest-less-loader" // 支持less
}
};
module.exports = config;
// transform: {
// "^.+\\.(ts|tsx)$": "ts-jest",
// },
// modulePathIgnorePatterns: ["./dist/", "./test/mocks.ts"],
// coveragePathIgnorePatterns: ["./test/mocks.ts"],