Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

Commit fccec9f

Browse files
committed
Some jest config
1 parent ffa1904 commit fccec9f

File tree

1 file changed

+189
-0
lines changed

1 file changed

+189
-0
lines changed

jest.config.js

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
// For a detailed explanation regarding each configuration property, visit:
2+
// https://jestjs.io/docs/en/configuration.html
3+
4+
module.exports = {
5+
// All imported modules in your tests should be mocked automatically
6+
// automock: false,
7+
8+
// Stop running tests after `n` failures
9+
// bail: 0,
10+
11+
// Respect "browser" field in package.json when resolving modules
12+
// browser: false,
13+
14+
// The directory where Jest should store its cached dependency information
15+
// cacheDirectory: "/private/var/folders/zj/m36rb_wx6ddb953lr4qlg0b9y6hcv1/T/jest_yio0o1",
16+
17+
// Automatically clear mock calls and instances between every test
18+
clearMocks: true,
19+
20+
// Indicates whether the coverage information should be collected while executing the test
21+
collectCoverage: true,
22+
23+
// An array of glob patterns indicating a set of files for which coverage information should be collected
24+
collectCoverageFrom: [
25+
'src/**/*.js',
26+
'!**/node_modules/**',
27+
'!templates/**/*.{js,html,css}'
28+
],
29+
30+
// The directory where Jest should output its coverage files
31+
coverageDirectory: 'coverage',
32+
33+
// An array of regexp pattern strings used to skip coverage collection
34+
// coveragePathIgnorePatterns: [
35+
// "/node_modules/"
36+
// ],
37+
38+
// A list of reporter names that Jest uses when writing coverage reports
39+
// coverageReporters: [
40+
// "json",
41+
// "text",
42+
// "lcov",
43+
// "clover"
44+
// ],
45+
46+
// An object that configures minimum threshold enforcement for coverage results
47+
// coverageThreshold: null,
48+
49+
// A path to a custom dependency extractor
50+
// dependencyExtractor: null,
51+
52+
// Make calling deprecated APIs throw helpful error messages
53+
// errorOnDeprecated: false,
54+
55+
// Force coverage collection from ignored files using an array of glob patterns
56+
// forceCoverageMatch: [],
57+
58+
// A path to a module which exports an async function that is triggered once before all test suites
59+
// globalSetup: null,
60+
61+
// A path to a module which exports an async function that is triggered once after all test suites
62+
// globalTeardown: null,
63+
64+
// A set of global variables that need to be available in all test environments
65+
// globals: {},
66+
67+
// An array of directory names to be searched recursively up from the requiring module's location
68+
// moduleDirectories: [
69+
// "node_modules"
70+
// ],
71+
72+
// An array of file extensions your modules use
73+
// moduleFileExtensions: [
74+
// "js",
75+
// "json",
76+
// "jsx",
77+
// "ts",
78+
// "tsx",
79+
// "node"
80+
// ],
81+
82+
// A map from regular expressions to module names that allow to stub out resources with a single module
83+
// moduleNameMapper: {},
84+
85+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
86+
// modulePathIgnorePatterns: [],
87+
88+
// Activates notifications for test results
89+
// notify: false,
90+
91+
// An enum that specifies notification mode. Requires { notify: true }
92+
// notifyMode: "failure-change",
93+
94+
// A preset that is used as a base for Jest's configuration
95+
// preset: null,
96+
97+
// Run tests from one or more projects
98+
// projects: null,
99+
100+
// Use this configuration option to add custom reporters to Jest
101+
// reporters: undefined,
102+
103+
// Automatically reset mock state between every test
104+
// resetMocks: false,
105+
106+
// Reset the module registry before running each individual test
107+
// resetModules: false,
108+
109+
// A path to a custom resolver
110+
// resolver: null,
111+
112+
// Automatically restore mock state between every test
113+
// restoreMocks: false,
114+
115+
// The root directory that Jest should scan for tests and modules within
116+
// rootDir: null,
117+
118+
// A list of paths to directories that Jest should use to search for files in
119+
// roots: [
120+
// "<rootDir>"
121+
// ],
122+
123+
// Allows you to use a custom runner instead of Jest's default test runner
124+
// runner: "jest-runner",
125+
126+
// The paths to modules that run some code to configure or set up the testing environment before each test
127+
// setupFiles: [],
128+
129+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
130+
// setupFilesAfterEnv: [],
131+
132+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
133+
// snapshotSerializers: [],
134+
135+
// The test environment that will be used for testing
136+
testEnvironment: 'node'
137+
138+
// Options that will be passed to the testEnvironment
139+
// testEnvironmentOptions: {},
140+
141+
// Adds a location field to test results
142+
// testLocationInResults: false,
143+
144+
// The glob patterns Jest uses to detect test files
145+
// testMatch: [
146+
// "**/__tests__/**/*.[jt]s?(x)",
147+
// "**/?(*.)+(spec|test).[tj]s?(x)"
148+
// ],
149+
150+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
151+
// testPathIgnorePatterns: [
152+
// "/node_modules/"
153+
// ],
154+
155+
// The regexp pattern or array of patterns that Jest uses to detect test files
156+
// testRegex: [],
157+
158+
// This option allows the use of a custom results processor
159+
// testResultsProcessor: null,
160+
161+
// This option allows use of a custom test runner
162+
// testRunner: "jasmine2",
163+
164+
// This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
165+
// testURL: "http://localhost",
166+
167+
// Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
168+
// timers: "real",
169+
170+
// A map from regular expressions to paths to transformers
171+
// transform: null,
172+
173+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
174+
// transformIgnorePatterns: [
175+
// "/node_modules/"
176+
// ],
177+
178+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
179+
// unmockedModulePathPatterns: undefined,
180+
181+
// Indicates whether each individual test should be reported during the run
182+
// verbose: null,
183+
184+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
185+
// watchPathIgnorePatterns: [],
186+
187+
// Whether to use watchman for file crawling
188+
// watchman: true,
189+
};

0 commit comments

Comments
 (0)