forked from brody2consult/prettierx
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjest.config.js
More file actions
40 lines (37 loc) · 1.46 KB
/
jest.config.js
File metadata and controls
40 lines (37 loc) · 1.46 KB
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
"use strict";
const { isCI } = require("ci-info");
const ENABLE_TEST_RESULTS = isCI || !!process.env.ENABLE_TEST_RESULTS;
const ENABLE_CODE_COVERAGE = !!process.env.ENABLE_CODE_COVERAGE;
module.exports = {
setupFiles: ["<rootDir>/tests_config/run_spec.js"],
snapshotSerializers: [
"jest-snapshot-serializer-raw",
"jest-snapshot-serializer-ansi"
],
testRegex: "jsfmt\\.spec\\.js$|__tests__/.*\\.js$",
testPathIgnorePatterns: ["tests/new_react", "tests/more_react"],
collectCoverage: ENABLE_CODE_COVERAGE,
collectCoverageFrom: ["src/**/*.js", "index.js", "!<rootDir>/node_modules/"],
coveragePathIgnorePatterns: [
"<rootDir>/standalone.js",
"<rootDir>/src/doc/doc-debug.js",
"<rootDir>/src/main/massage-ast.js"
],
coverageReporters: ["text", "html", "cobertura"],
moduleNameMapper: {
// Jest wires `fs` to `graceful-fs`, which causes a memory leak when
// `graceful-fs` does `require('fs')`.
// Ref: https://github.com/facebook/jest/issues/2179#issuecomment-355231418
// If this is removed, see also scripts/build/build.js.
"graceful-fs": "<rootDir>/tests_config/fs.js",
"prettier/local": "<rootDir>/tests_config/require_prettierx.js",
"prettier/standalone": "<rootDir>/tests_config/require_standalone.js"
},
testEnvironment: "node",
transform: {},
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
],
reporters: ["default"].concat(ENABLE_TEST_RESULTS ? "jest-junit" : [])
};