Skip to content
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

two instances of karma test runner #43

Closed
thescientist13 opened this issue Dec 9, 2016 · 2 comments
Closed

two instances of karma test runner #43

thescientist13 opened this issue Dec 9, 2016 · 2 comments

Comments

@thescientist13
Copy link
Member

When running npm run test, the test runner seems to be running twice

09 12 2016 14:59:41.735:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/
09 12 2016 14:59:41.735:INFO [launcher]: Launching browser Chrome with unlimited concurrency
09 12 2016 14:59:41.748:INFO [launcher]: Starting browser Chrome
[default] Checking started in a separate process...
09 12 2016 14:59:42.516:INFO [Chrome 54.0.2840 (Mac OS X 10.12.1)]: Connected on socket /#xRHn2DueZ-XPVO2NAAAA with id 72282202
[default] Ok, 1.309 sec.
 Chrome 54.0.2840 (Mac OS X 10.12.1): Executed 11 of 13 (skipped 2) SUCCESS (3.635 secs / 1.043 secs)

Chrome 54.0.2840 (Mac OS X 10.12.1): Executed 11 of 13 (skipped 2) SUCCESS (3.635 secs / 1.043 secs)
@thescientist13
Copy link
Member Author

Not sure if it's related, but when karma starts, it looks like webpack is getting run for every spec file?

$ npm run test

> seed-webapp@0.3.0 test /Users/obuckley/Workspace/github/thegreenhouseio/angular2-webpack-seed
> rimraf ./reports && karma start ./karma.conf.js

webpack: wait until bundle finished:
webpack: wait until bundle finished:
webpack: wait until bundle finished:
webpack: wait until bundle finished:
webpack: wait until bundle finished:

The line webpack: wait until bundle finished: seems to be be equal to the number of .spec.ts files in the repo

@thescientist13
Copy link
Member Author

seems to be how karma-webpack works
https://github.com/webpack-contrib/karma-webpack#alternative-usage

This configuration is more performant, but you cannot run single test anymore (only the complete suite).
The above configuration generates a webpack bundle for each test. For many testcases this can result in many big files. The alterative configuration creates a single bundle with all testcases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

1 participant