question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not fail when the test set is empty

See original GitHub issue

Karma fails if there are no matching tests. Shouldn’t it just skip tests if there are none? If not the default, than I think this should be configureable.

I realize you may ask “why are you running karma if you have no tests?” but it’s common to run karma along with a bunch of other tasks in grunt. If there are no matching tests, the whole task fails.

› ./node_modules/karma/bin/karma start
INFO [karma]: Karma v0.10.9 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [launcher]: Starting browser Firefox
WARN [watcher]: Pattern "/Users/mhughes/foo/src/test/js/**/**.js" does not match any file.
INFO [Firefox 27.0.0 (Mac OS X 10.9)]: Connected on socket rreoh8Sf1OuByCl2ZRyZ
INFO [Chrome 32.0.1700 (Mac OS X 10.9.1)]: Connected on socket 0nvZF76Y3Aay8m1-ZRya
Firefox 27.0.0 (Mac OS X 10.9) LOG: 'Tests loaded, ready to run.'
Firefox 27.0.0 (Mac OS X 10.9): Executed 0 of 0 SUCCESS (0 secs / 0 secs)
Chrome 32.0.1700 (Mac OS X 10.9.1) LOG: 'Tests loaded, ready to run.'
Firefox 27.0.0 (Mac OS X 10.9): Executed 0 of 0 ERROR (0.057 secs / 0 secs)
                              Firefox 27.0.0 (Mac OS X 10.9): Executed 0 of 0 ERROR (0.057 secs / 0 secs)
Chrome 32.0.1700 (Mac OS X 10.9.1): Executed 0 of 0 ERROR (0.283 secs / 0 secs)

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Reactions:2
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
adamreisnzcommented, Feb 10, 2016

@dignifiedquire what version of Karma was this fix included in? I’m using 0.13.19 and the config setting seems to be ignored:

failOnEmptyTestSuite: false
10 02 2016 14:51:38.728:INFO [karma]: Karma v0.13.19 server started at http://localhost:9876/
10 02 2016 14:51:38.753:INFO [launcher]: Starting browser PhantomJS
10 02 2016 14:51:39.563:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket /#BAWUm-MAtCqIImEJAAAA with id 85239157

PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 0 of 0 ERROR (0.004 secs / 0 secs)


npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "test"
npm ERR! node v5.5.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! ...@1.0.0 test: `karma start karma.conf.js`
npm ERR! Exit status 1
1reaction
budde377commented, Feb 10, 2016

@adambuczynski This was committed on Jan 11 and the latest release (0.13.19) is from Jan 6, so the the feature hasn’t been released yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fail On Empty Test Suite
A module is considered empty if no tests are executed regardless of whether tests are defined. This is useful to catch scenarios were...
Read more >
How to ignore empty test files in Jest from throwing error
Your best bet is to set those test to be skipped as todos. An example of an empty test that passes without problem...
Read more >
Using matchers
This TestFailedException will cause the test to fail. Trait must.Matchers is an alternative to should.Matchers that provides the exact same meaning, syntax, ...
Read more >
API Reference
A blazing fast unit test framework powered by Vite.
Read more >
How to test if a parameter has been set to the empty string?
When the parameter is not set, the test should fail. Why does the following not succeed? $ unset aa $ if [ ${aa}==" ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found