Elliot Chance
Elliot Chance

Reputation: 5736

Is it possible to filter files in Karma?

We are using Karma for testing and I can easily run the full suite with:

karma start

Is there a way I can run a single file without having to comment out all the files I don't want to run in the karma.conf.js?

Upvotes: 1

Views: 580

Answers (1)

Brij Raj Singh - MSFT
Brij Raj Singh - MSFT

Reputation: 5113

you can't run for a particular file name but you can filter by the expression

Karma run
karma run -- --grep=filteredtestexpr

It doesn't filter by filename, rather by the testdescription's regular expression.

and yes this works with karma-mocha https://github.com/karma-runner/karma-mocha

See if it helps you.

Upvotes: 1

Related Questions