mercredi 30 septembre 2015

Can Karma refresh the file changes without running the whole suite again?

I am using Karma through Grunt. We have around 1000 tests and it is a bit painful to have them all run whenever we change a file (autoWatch = true).

This is what we are doing now:

  1. Start Karma with singleRun=false, autoWatch=false.
  2. Open the debug page and grep for a specific suite (using mocha html reporter).
  3. Change a test or file related to that suite.
  4. Refresh the debug page to run the set of tests again.
  5. My changes in (3) haven't been picked up by Karma so the tests still behave as if nothing had changed.

This is what I need:

  1. Start Karma with singleRun=false, magicOption=true.
  2. Open the debug page and grep for a specific suite (using mocha html reporter).
  3. Change a test or file related to that suite.
  4. Refresh the debug page to run the set of tests again.
  5. My changes are porperly picked up and only the grepped tests are run.

If I set autoWatch=true I get what I need but the whole suite of 1000 tests is run in the background whenever I change a file, which soon collapses my environment.

I don't think there is anything equivalent to magicOption according to Karma docs but, is there any way to achieve the same behaviour?

Thanks a lot.

Aucun commentaire:

Enregistrer un commentaire