Files
test-repo/jest.config.js
T
fisker Cheung 412694e1c5 Tweak test and CI configs (#7866)
* Set `jest` verbose to false by default

* Correct `doc-debug.js` path

* Remove outdated ignore patterns

* Exclude Node.js 13 on macos
2020-03-26 17:02:43 +02:00

38 lines
1.3 KiB
JavaScript

"use strict";
const { isCI } = require("ci-info");
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$",
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: {
// 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_prettier.js",
"prettier/standalone": "<rootDir>/tests_config/require_standalone.js",
},
testEnvironment: "node",
transform: {},
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname",
],
verbose: isCI,
};