forked from prettier/prettier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
35 lines (32 loc) · 1.1 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
"use strict";
const installPrettier = require("./scripts/install-prettier");
const ENABLE_CODE_COVERAGE = !!process.env.ENABLE_CODE_COVERAGE;
if (process.env.NODE_ENV === "production" || process.env.INSTALL_PACKAGE) {
process.env.PRETTIER_DIR = installPrettier();
}
module.exports = {
setupFiles: ["<rootDir>/tests_config/run_spec.js"],
snapshotSerializers: [
"jest-snapshot-serializer-raw",
"jest-snapshot-serializer-ansi",
],
testRegex: "jsfmt\\.spec\\.js$|__tests__/.*\\.js$",
collectCoverage: ENABLE_CODE_COVERAGE,
collectCoverageFrom: ["src/**/*.js", "index.js", "!<rootDir>/node_modules/"],
coveragePathIgnorePatterns: [
"<rootDir>/standalone.js",
"<rootDir>/src/document/doc-debug.js",
"<rootDir>/src/main/massage-ast.js",
],
coverageReporters: ["text", "lcov"],
moduleNameMapper: {
"prettier/local": "<rootDir>/tests_config/require_prettier.js",
"prettier/standalone": "<rootDir>/tests_config/require_standalone.js",
},
testEnvironment: "node",
transform: {},
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname",
],
};