Sunday 15 January 2012

How do I run only certain tests in karma? -



How do I run only certain tests in karma? -

i have karma config set correctly, config file, running in background, great. sa alter , save file, reruns tests.... 750 of unit tests. want able run few. short of manually hacking config file or commenting out hundreds of tests across many files, there easy way it?

e.g. when running command line server tests using mocha, utilize regexp: mocha -g 'only tests want'. makes much easier debug , check.

so sense foolish. mocha supports narrow version of regexp matching.

this runs tests

describe('all tests',function(){ describe('first tests',function(){ }); describe('second tests',function(){ }); });

this runs 'first tests'

describe('all tests',function(){ describe.only('first tests',function(){ }); describe('second tests',function(){ }); });

you can it.only()

i should have noticed that. sigh.

karma-runner karma-mocha

No comments:

Post a Comment