-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Painless with Webpack #20
Comments
Some relevant extracts of the project files: package.json
webpack.config.js
karma.conf.js
tests.webpack.js
As you can see, I have set as "noParse" both Sinon and Painless, to avoid Webpack to parse them.
OK, require is not understood because Webpack couldn't parse it.
Beside, it tries to parse (and complains) all files at top-level of node_modules/painless.
What I am missing? |
Mmm, seems relevant: sinonjs/sinon#555 and webpack/webpack#304 |
Thanks for reporting. This appears to be an issue with painless and webpack. Painless has a dynamic require that forces webpack to include all files in the folder. I will work to fix this. There is also an issue with sinon using UMD module definitions. I will have to fix that as well. It is going to take a few days. Browserify works currently. You can either use that or wait a few days for a fix. |
I will wait... 😣 For Sinon, from what I have read, the version 2.0 should fix that (but it isn't out yet), and meanwhile, the trick I found might do the right thing:
Side note: you mention "It is possible to switch out assertion and mocking libraries". For clueless people like me, it would be nice to show how... At least if we want to upgrade Chai or Sinon. 😄 |
I mentioned webpack once in In order to use another mocking library, you can just install another library via NPM and require it yourself. Sinon and chai will still be included as well, so that won't fix your issue. You can also do the alias thing you are doing above with browserify or webpack (when it's fixed). |
Is this fixed now? |
Beware: I am new to Painless and to Webpack!
I have some experience with Karma, though...
I am trying to use Webpack for a small AngularJS 1 project, with ES5.
So I made a little variant of the https://github.com/preboot/angular-webpack project.
Instead of using Jasmine, I try to use Painless.
(BTW, the choice of name is poor, if I search painless test or similar, I get lot of wrong hits... 😧)
The project itself works, I can get it running in the browser. Things get trickier when I try to test...
So, I would appreciate if you could give some instructions, or even better some sample files, showing how to use Painless with Webpack and Karma.
The text was updated successfully, but these errors were encountered: