You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(helpers): deprecate import from ts-jest, now ts-jest/utils
Importing from `ts-jest` everything will possibly make collision with
future jest API. Also any star export or import might not be compatible
with the target project. Now all helpers to be used in tests or config
files have been moved to `ts-jest/utils`. Original ones have been kept
in `ts-jest` for now, with a deprecation warning when using them.
Closes#782
"[level:40] The \`mocked\` helper has been moved to \`ts-jest/utils\`. Use \`import { mocked } from 'ts-jest/utils'\` instead.
75
+
",
76
+
]
77
+
`)
78
+
})
79
+
it('should warn when using createJestPreset',()=>{
80
+
tsJest.createJestPreset()
81
+
expect(target.lines.warn).toMatchInlineSnapshot(`
82
+
Array [
83
+
"[level:40] The \`createJestPreset\` helper has been moved to \`ts-jest/utils\`. Use \`import { createJestPreset } from 'ts-jest/utils'\` instead.
84
+
",
85
+
]
86
+
`)
87
+
})
88
+
it('should warn when using pathsToModuleNameMapper',()=>{
89
+
tsJest.pathsToModuleNameMapper({})
90
+
expect(target.lines.warn).toMatchInlineSnapshot(`
91
+
Array [
92
+
"[level:40] The \`pathsToModuleNameMapper\` helper has been moved to \`ts-jest/utils\`. Use \`import { pathsToModuleNameMapper } from 'ts-jest/utils'\` instead.
0 commit comments