Skip to content

Commit c0171ca

Browse files
committed
fix(config/jest): revert: import and apply ts-jest preset instead
The original change was intended to make the `jest.config.js` this package exports more resilient to ts-jest being installed in a nested `./node_modules` location, but it doesn't work and furthermore it breaks the `jest.config.js`.
1 parent 35fd8da commit c0171ca

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/config/jest.config.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/** @typedef {import('@jest/types').Config.InitialOptions} JestConfig */
22

33
const {ifAnyDep, hasAnyDep, hasFile, fromRoot} = require('../utils')
4-
const {jsWithTs: preset} = require('ts-jest/presets')
54

65
const ignores = [
76
'/node_modules/',
@@ -60,8 +59,7 @@ const jestConfig = {
6059
}
6160

6261
if (hasAnyDep('ts-jest') || hasFile('tsconfig.json')) {
63-
Object.assign(jestConfig, preset)
64-
62+
jestConfig.preset = 'ts-jest/presets/js-with-ts'
6563
jestConfig.globals['ts-jest'] = {
6664
diagnostics: {
6765
warnOnly: true,

0 commit comments

Comments
 (0)