__WEBPACK_IMPORTED_MODULE_XXX is not a function
IsurusPrime opened this issue · 3 comments
I've been looking all day and trying various solutions, but, I'll be the first to admit I'm not the best at finding the results for these kind of issues.
In our Travis-CLI tests, we're running them through several different browsers, and some aren't importing the expect-jsx module properly. IE 11 and Safari 9.1, they fail with:
__WEBPACK_IMPORTED_MODULE_5_expect___default()(actualElement).toEqualJSX is not a function. (In '__WEBPACK_IMPORTED_MODULE_5_expect___default()(actualElement).toEqualJSX(expectedElement)', '__WEBPACK_IMPORTED_MODULE_5_expect___default()(actualElement).toEqualJSX' is undefined)
We have babel-polyfill enabled. Checked our unit test files to turn it on and the browsers complained I could only have one instance of that turned on. It is located at the top of our Karma config settings files list for karma, so that seems to be in order. There's also a babelPreprocessor setting as well.
In our local test runs, I've tried Firefox, Safari, Chrome that I have installed, and, they all pass with flying colors.
Any ideas what I should try next?
tried changing from the Karma babel-polyfill settings and just requiring it in our test wrapper file, and got this error instead:
Object doesn't support property or method 'toEqualJSX'
at Anonymous function (eval code:17:1053)
I have no precise idea on why this is happening. If you are still early on in your project maybe give a try to https://github.com/facebook/jest which is very good testing framework for react components.
If this is still an issue, open a new issue with reproducible setup.