Closed rmartins90 closed 6 years ago
@rmartins90 Yep, that’s expected — inject-loader
only works with Webpack.
I'm having this issue too.
@plasticine Jest is not an alternative to Webpack but it is an alternative to Karma so did you mean "only works with Karma"?
Jest is not an alternative to Webpack but it is an alternative to Karma so did you mean "only works with Karma"?
@tristanpendergrass Nope, that’s not really what I meant, but I can see why that was perhaps not as clear as it could’ve been.
You can use whatever test runner you want, but your test code has to be compiled by Webpack before passing it to the runner, thus @rmartins90’s issue above with the inline loader syntax, which is specific to Webpack .
inject-loader
requires roughly the following;
1) Your test code --> 2) Webpack --> 3) Some test runner
How you organise this workflow is entirely up to you. I suspect it would not be too hard at all to integrate with Jest if you wanted — https://facebook.github.io/jest/docs/en/webpack.html
Can't get this working with Jest. Got a