|
3 | 3 | * https://jestjs.io/docs/configuration
|
4 | 4 | */
|
5 | 5 |
|
6 |
| -// import type { Config } from "jest"; |
7 |
| -import type { JestConfigWithTsJest } from "ts-jest"; |
| 6 | +import type { Config } from "jest"; |
| 7 | +// import type { JestConfigWithTsJest } from "ts-jest"; |
8 | 8 |
|
9 |
| -const config: JestConfigWithTsJest = { |
| 9 | +const config: Config = { |
10 | 10 | // All imported modules in your tests should be mocked automatically
|
11 | 11 | // automock: false,
|
12 | 12 |
|
@@ -53,7 +53,7 @@ const config: JestConfigWithTsJest = {
|
53 | 53 | // Make calling deprecated APIs throw helpful error messages
|
54 | 54 | // errorOnDeprecated: false,
|
55 | 55 |
|
56 |
| - extensionsToTreatAsEsm: [".ts"], |
| 56 | + // extensionsToTreatAsEsm: [".ts"], |
57 | 57 |
|
58 | 58 | // The default configuration for fake timers
|
59 | 59 | // fakeTimers: {
|
@@ -93,9 +93,9 @@ const config: JestConfigWithTsJest = {
|
93 | 93 | // ],
|
94 | 94 |
|
95 | 95 | // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
|
96 |
| - moduleNameMapper: { |
97 |
| - "^(\\.{1,2}/.*)\\.js$": "$1", |
98 |
| - }, |
| 96 | + // moduleNameMapper: { |
| 97 | + // "^(\\.{1,2}/.*)\\.js$": "$1", |
| 98 | + // }, |
99 | 99 |
|
100 | 100 | // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
101 | 101 | // modulePathIgnorePatterns: [],
|
@@ -151,7 +151,7 @@ const config: JestConfigWithTsJest = {
|
151 | 151 | // snapshotSerializers: [],
|
152 | 152 |
|
153 | 153 | // The test environment that will be used for testing
|
154 |
| - // testEnvironment: "jest-environment-node", |
| 154 | + // testEnvironment: "node", |
155 | 155 |
|
156 | 156 | // Options that will be passed to the testEnvironment
|
157 | 157 | // testEnvironmentOptions: {},
|
@@ -180,28 +180,38 @@ const config: JestConfigWithTsJest = {
|
180 | 180 | // testRunner: "jest-circus/runner",
|
181 | 181 |
|
182 | 182 | // A map from regular expressions to paths to transformers
|
183 |
| - transform: { |
184 |
| - "^.+\\.tsx?$": [ |
185 |
| - "ts-jest", |
186 |
| - { |
187 |
| - diagnostics: { |
188 |
| - ignoreCodes: [1343], |
189 |
| - }, |
190 |
| - astTransformers: { |
191 |
| - before: [ |
192 |
| - { |
193 |
| - path: "node_modules/ts-jest-mock-import-meta", // or, alternatively, 'ts-jest-mock-import-meta' directly, without node_modules. |
194 |
| - }, |
195 |
| - ], |
196 |
| - }, |
197 |
| - }, |
198 |
| - ], |
199 |
| - }, |
| 183 | + // transform: { |
| 184 | + // "^.+\\.tsx?$": [ |
| 185 | + // "ts-jest", |
| 186 | + // { |
| 187 | + // diagnostics: { |
| 188 | + // ignoreCodes: [1343], |
| 189 | + // }, |
| 190 | + // astTransformers: { |
| 191 | + // before: [ |
| 192 | + // { |
| 193 | + // path: "node_modules/ts-jest-mock-import-meta", // or, alternatively, 'ts-jest-mock-import-meta' directly, without node_modules. |
| 194 | + // }, |
| 195 | + // ], |
| 196 | + // }, |
| 197 | + // }, |
| 198 | + // ], |
| 199 | + // }, |
| 200 | + // transform: { |
| 201 | + // "^.+\\.tsx?$": [ |
| 202 | + // "ts-jest", |
| 203 | + // { |
| 204 | + // useESM: true, |
| 205 | + // astTransformers: { before: [{ path: "ts-jest-mock-import-meta" }] }, |
| 206 | + // diagnostics: { ignoreCodes: [1343] }, |
| 207 | + // }, |
| 208 | + // ], |
| 209 | + // "node_modules/nodemailer-express-handlebars/.+\\.(j|t)sx?$": "ts-jest", |
| 210 | + // }, |
200 | 211 |
|
201 | 212 | // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
202 | 213 | // transformIgnorePatterns: [
|
203 |
| - // "/node_modules/", |
204 |
| - // "\\.pnp\\.[^\\/]+$" |
| 214 | + // "node_modules/?!(nodemailer-express-handlebars/.*)", |
205 | 215 | // ],
|
206 | 216 |
|
207 | 217 | // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
|
|
0 commit comments