Files
test-repo/jest.config.js
T

35 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-07-16 21:49:37 +10:00
"use strict";
2020-04-18 01:24:22 +08:00
const installPrettier = require("./scripts/install-prettier");
2018-12-18 08:16:32 +08:00
const ENABLE_CODE_COVERAGE = !!process.env.ENABLE_CODE_COVERAGE;
2020-04-23 10:37:09 +08:00
if (process.env.NODE_ENV === "production" || process.env.INSTALL_PACKAGE) {
2020-04-18 01:24:22 +08:00
process.env.PRETTIER_DIR = installPrettier();
}
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: {
"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
};