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
I tried to get enzyme-extensions running with a Jasmine/Karma/Webpack setup and got this error:
webpack: Compiling...
ERROR in ./node_modules/@commercetools/enzyme-extensions/src/until/until.js
Module parse failed: Unexpected token (4:4)
You may need an appropriate loader to handle this file type.
| const defaultedOptions = {
| maxDepth: null,
| ...options,
| };
|
It appears that enzyme-extensions does not transpile its code before publishing to npm. This generally goes against the convention of npm. I tried this workaround which I'm sure would work for my situation, but I couldn't get it working in the 2 minutes I tried.
The way my test build is set up is that Karma runs Webpack to build the app + test code, then the built bundle is returned to Karma which starts up ChromeHeadless and uses Jasmine to execute the tests in the bundle. This probably isn't the only way to set it up, but I'm sure I'm also not alone in setting up my tests this way.
My understanding is that the typical Jest setup works differently, so I'm assuming the use of the spread operator is a non-issue for those setups.
Anyway, cool module. I probably won't spend any more time on it, so feel free to close this issue. I just wanted to give feedback that the way the module works now could cause issues with non-Jest setups.
The text was updated successfully, but these errors were encountered:
Thanks for the feedback! We use it in a setup in which we transpile. Yes, it's true it's against best practices. We can think or transpiling or just removing features which likely need it.
Thanks for the heads-up! I opened enzymejs/enzyme#1863 today which adds renderProp to enzyme itself. The features will get transpiled there.
I wouldn't do anything for now and see whether renderProp makes it in. If it does, we will drop it in the next release and you should be able to use the library. If it doesn't, we can always remove the rest params & spread used in this package's renderProp.
Now that enzymejs/enzyme#1863 made it in, I'd close this issue. We'll deprecate/drop renderProp in this package and recommend to use the one from enzyme itself.
I tried to get enzyme-extensions running with a Jasmine/Karma/Webpack setup and got this error:
It appears that enzyme-extensions does not transpile its code before publishing to npm. This generally goes against the convention of npm. I tried this workaround which I'm sure would work for my situation, but I couldn't get it working in the 2 minutes I tried.
The way my test build is set up is that Karma runs Webpack to build the app + test code, then the built bundle is returned to Karma which starts up ChromeHeadless and uses Jasmine to execute the tests in the bundle. This probably isn't the only way to set it up, but I'm sure I'm also not alone in setting up my tests this way.
My understanding is that the typical Jest setup works differently, so I'm assuming the use of the spread operator is a non-issue for those setups.
Anyway, cool module. I probably won't spend any more time on it, so feel free to close this issue. I just wanted to give feedback that the way the module works now could cause issues with non-Jest setups.
The text was updated successfully, but these errors were encountered: