Skip to content

Feature: Run unit tests faster, and run them continuously in watch mode #875

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

Closed
asselin opened this issue Aug 27, 2017 · 4 comments
Closed

Comments

@asselin
Copy link

asselin commented Aug 27, 2017

I'd like to be able to run unit tests faster, and also have them run continuously in the background in watch mode, similar to what npm run dev does.

To do that, I switched the test running from Karma -> mocha-webpack, and from PhantomJS to JSDOM. PR #874 has the code changes. Coverage reports are maintained using nyc.

I added a new command npm run unit:watch that monitors for code changes continuously in the background, and re-runs any affected unit tests (see http://zinserjan.github.io/mocha-webpack/#watch-mode-watch).

Any interest in merging this PR? Or in making it an option for vue init?

@LinusBorg
Copy link
Contributor

Hey, thanks for tour contribution.

However we are coherently evaluating if we want to a itch karma for something else, but haven't decided yet.

So this issue + PR will have to wait until we have settled on the future solution.

@ckitt
Copy link

ckitt commented Sep 3, 2017

how about setting autoWatch to be true in karma.conf.js, or using CLI options --auto-watch in the package.json

// package.json
"unit:watch": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --auto-watch",

This should be the simplest way to achieve the goal

References: http://karma-runner.github.io/1.0/config/configuration-file.html

@LinusBorg
Copy link
Contributor

Update: We will swithc to jest (#817), so as explained in #874, this will not be happening.

@ilearnio
Copy link

We did our custom unit testing setup, without karma and webpack so we don't need to wait minutes for building the bundle, launching browser etc. All is working perfectly and fast with just Node, jsdom to simulate browser, Mocha. I wish such setup would be there by default in vue-webpack-template

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

No branches or pull requests

4 participants