Files
test-repo/jest.config.js
T

35 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-07-16 21:49:37 +10:00
"use strict";
2018-12-18 08:16:32 +08:00
const ENABLE_CODE_COVERAGE = !!process.env.ENABLE_CODE_COVERAGE;
2017-07-16 21:49:37 +10:00
module.exports = {
setupFiles: ["<rootDir>/tests_config/run_spec.js"],
snapshotSerializers: [
"jest-snapshot-serializer-raw",
2020-03-21 22:07:52 +02:00
"jest-snapshot-serializer-ansi",
],
2017-07-16 21:49:37 +10:00
testRegex: "jsfmt\\.spec\\.js$|__tests__/.*\\.js$",
2018-12-18 08:16:32 +08:00
collectCoverage: ENABLE_CODE_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",
2020-03-26 23:02:43 +08:00
"<rootDir>/src/document/doc-debug.js",
2020-03-21 22:07:52 +02:00
"<rootDir>/src/main/massage-ast.js",
],
2020-03-23 17:56:02 +08:00
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
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",
2020-03-21 22:07:52 +02:00
"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",
2020-03-21 22:07:52 +02:00
"jest-watch-typeahead/testname",
2018-07-07 12:11:04 -04:00
],
2017-07-16 21:49:37 +10:00
};