|
1 | 1 | import type { Config } from "jest"; |
| 2 | +import { resolve } from "path"; |
2 | 3 |
|
3 | 4 | /* |
4 | 5 | * For a detailed explanation regarding each configuration property and type check, visit: |
@@ -163,31 +164,27 @@ const config: Config = { |
163 | 164 | // testRunner: "jest-circus/runner", |
164 | 165 |
|
165 | 166 | // A map from regular expressions to paths to transformers |
166 | | - // transform: { |
167 | | - // '^.+\\.tsx?$': [ |
168 | | - // 'ts-jest', |
169 | | - // { |
170 | | - // tsconfig: 'src/view/tsconfig.spec.json', |
171 | | - // }, |
172 | | - // ], |
173 | | - // 'node_modules': [ |
174 | | - // 'babel-jest', |
175 | | - // { |
176 | | - // presets: [ |
177 | | - // '@babel/preset-env' |
178 | | - // ], |
179 | | - // plugins: [ |
180 | | - // '@babel/plugin-transform-modules-commonjs', |
181 | | - // ] |
182 | | - // } |
183 | | - // ] |
184 | | - // }, |
| 167 | + transform: { |
| 168 | + "^.+\\.tsx?$": [ |
| 169 | + "ts-jest", |
| 170 | + { |
| 171 | + tsconfig: resolve(__dirname, "../tsconfig.json"), |
| 172 | + }, |
| 173 | + ], |
| 174 | + node_modules: [ |
| 175 | + "babel-jest", |
| 176 | + { |
| 177 | + presets: ["@babel/preset-env"], |
| 178 | + plugins: ["@babel/plugin-transform-modules-commonjs"], |
| 179 | + }, |
| 180 | + ], |
| 181 | + }, |
185 | 182 |
|
186 | 183 | // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation |
187 | | - // 'transformIgnorePatterns': [ |
188 | | - // // These use ES modules, so need to be transformed |
189 | | - // 'node_modules/(?!(?:@vscode/webview-ui-toolkit|@microsoft/.+|exenv-es6)/.*)' |
190 | | - // ], |
| 184 | + transformIgnorePatterns: [ |
| 185 | + // These use ES modules, so need to be transformed |
| 186 | + "node_modules/(?!(?:@vscode/webview-ui-toolkit|@microsoft/.+|exenv-es6|nanoid)/.*)", |
| 187 | + ], |
191 | 188 |
|
192 | 189 | // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them |
193 | 190 | // unmockedModulePathPatterns: undefined, |
|
0 commit comments