Files
test-repo/jest.config.js
T

57 lines
1.7 KiB
JavaScript
Raw Normal View History

2017-07-16 21:49:37 +10:00
"use strict";
const ENABLE_COVERAGE = !!process.env.CI;
2018-05-27 21:36:12 +10:00
const requiresPrettierInternals = [
"tests_integration/__tests__/util-shared.js",
"tests_integration/__tests__/help-options.js"
];
const semver = require("semver");
const isOldNode = semver.parse(process.version).major <= 4;
2017-07-16 21:49:37 +10:00
module.exports = {
setupFiles: ["<rootDir>/tests_config/run_spec.js"],
snapshotSerializers: [
"jest-snapshot-serializer-raw",
"jest-snapshot-serializer-ansi"
],
2017-07-16 21:49:37 +10:00
testRegex: "jsfmt\\.spec\\.js$|__tests__/.*\\.js$",
2018-05-27 21:36:12 +10:00
testPathIgnorePatterns: ["tests/new_react", "tests/more_react"].concat(
isOldNode ? requiresPrettierInternals : []
),
2017-07-16 21:49:37 +10:00
collectCoverage: ENABLE_COVERAGE,
collectCoverageFrom: ["src/**/*.js", "index.js", "!<rootDir>/node_modules/"],
2017-07-16 21:49:37 +10:00
coveragePathIgnorePatterns: [
2018-05-24 15:30:45 -03:00
"<rootDir>/standalone.js",
"<rootDir>/src/doc/doc-debug.js",
"<rootDir>/src/main/massage-ast.js"
],
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
2018-05-24 15:30:45 -03:00
// If this is removed, see also scripts/build/build.js.
2018-05-27 21:36:12 +10:00
"graceful-fs": "<rootDir>/tests_config/fs.js",
"prettier/local": "<rootDir>/tests_config/require_prettier.js",
"prettier/standalone": "<rootDir>/tests_config/require_standalone.js"
},
2018-07-03 08:06:29 +02:00
testEnvironment: "node",
2018-07-04 21:54:39 +02:00
transform: {},
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
2018-07-07 12:11:04 -04:00
],
reporters: process.env.REPORT_SUMMARIES
? [
"default",
[
"jest-junit",
{
output: "./test-results/jest/junit.xml"
}
]
]
: undefined
2017-07-16 21:49:37 +10:00
};