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