Closed artola closed 4 years ago
@kulshekhar do you have some hint for this issue?
@artola Have you solved the problem? I encountered the same issue
@davydkov It is breaking as described above with v23.6 ... no workaround.
i will close this issue. If you have any issues like this with latest ts-jest
, please create another issue.
Issue :
With the following
jest.config.js
:It fails when I add to
babel.config.js
:Note: Babel compile without problem with webpack.
It seems that
/node_modules/@babel/core/lib/config/config-chain.js
() is not receiving thepathToTest
as I debugged it is also not in thecontext
(undefined
):Expected behavior :
pathToTest
should be passed into the context to handle it in the Babel config, as stated in the Babel configuration, when it is Babel MatchPatterns for string | RegExp.Importantly, if either of these are used, Babel requires that the filename option be present, and will consider it an error otherwise.
Workaround using the Function parameter:
(filename: string | void, context: { callee: { name: string } | void, envName: string }) => boolean is a general callback that should return a boolean to indicate whether it is a match or not. The function is passed the filename or undefined if one was not given to Babel. It is also passed the current envName and callee options that were specified by the top-level call to Babel.
Debug log:
Minimal repo :