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
prior to this commit 04ab3de , after the typescript had been transformed the transformed source was then passed to babel for an addition transform if you did not explicitly skip this step with skipBabel This would have performed hoisting.
This has now been changed to opt in. ts-jest does attempt to port from the old method to the new but it only works for skipBabel = false.
There is now the concept of presets in jest. ts-jest presets help configure the transform. Although one of these presets is called jsWithBabel it is not what now controls babel hoisting.
For that you need to set the globals/ts-jest/ babelConfig property. In the case of your example repo setting this to true would have resulted in hoisting of deepUnmock.
Babel Config option
ts-jest by default does NOT use Babel. But you may want to use it, especially if your code rely on Babel plugins to make some transformations. ts-jest can call the BabelJest processor once TypeScript has transformed the source into JavaScript.
The option is babelConfig and it works pretty much as the tsConfig option, except that it is disabled by default. Here is the possible values it can take:
false: the default, disables the use of Babel
true: enables Babel processing. ts-jest will try to find a .babelrc, .babelrc.js file or a babel section in the package.json file of your project and use it as the config to pass to babel-jest processor.
{ ... }: inline Babel options. You can also set this to an empty object ({}) so that the default Babel config file is not used.
Note that ts-jest does now do hoisting but it does not currently hoist deepUnmock. See my comment
Issue :
deepUnmock doesn't work on ts-jest@24
Expected behavior :
deepUnmock should work on ts-jest@24
Debug log:
log file content
# content of ts-jest.log : No content
Minimal repo :
https://github.com/hojovi/jest_test_failure
The tests successes in ts-jest@23 but fails in ts-jest@24.
The text was updated successfully, but these errors were encountered: