forked from lingui/js-lingui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
44 lines (41 loc) · 1.2 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
const { pathsToModuleNameMapper } = require("ts-jest/utils")
const tsConfig = require("./tsconfig.json")
/**
* @type {import('jest').Config}
*/
module.exports = {
roots: ["<rootDir>/packages/"],
rootDir: process.cwd(),
testMatch: ["**/?(*.)test.(js|ts|tsx)", "**/test/index.(js|ts|tsx)"],
testPathIgnorePatterns: ["/node_modules/", "/locale/"],
testURL: "http://localhost",
collectCoverage: true,
collectCoverageFrom: [
"**/*.{ts,tsx}",
"!**/*.d.ts",
"!**/node_modules/**",
"!**/build/**",
],
coverageDirectory: "<rootDir>/coverage/",
coveragePathIgnorePatterns: [
"node_modules",
"scripts",
// removed because detect-locale package is ignored
// "locale",
"fixtures",
".*.json$",
".*.js.snap$",
],
coverageReporters: ["html", "lcov", "text"],
modulePathIgnorePatterns: ["/build"],
moduleNameMapper: pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
prefix: "<rootDir>/",
}),
reporters: ["default", "jest-junit"],
setupFiles: ["set-tz/utc"],
setupFilesAfterEnv: [require.resolve("./scripts/jest/env.js")],
snapshotSerializers: [
"jest-serializer-html",
require.resolve("./scripts/jest/stripAnsiSerializer.js"),
],
}