-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Do not fail when the test set is empty #926
Do not fail when the test set is empty #926
Comments
This is by design. I guess it could be configurable. |
Any chance you could point me to where this would go? I poked around a little bit this morning, but didn't see it. Ideally it would happen before we start the server. |
It's here Lines 140 to 142 in 249b27d
Probably not the best place ;-) Long term, we should add some notion of "reason why it fails". Now there is just "error", which was originally error in the browser (eg. syntax error)... but now we use this "error" for other reasons such as "0 test" failure or when a test run got cancelled (eg. because a preprocessor failed). |
I would prefer it to warn if there are no tests and not fail. Maybe its a new project with no tests yet. |
I agree this should be configurable. A warning instead of a failure would be nice as well. At the company I work for we setup a shared grunt workflow for all projects to use however we maintain some legacy code-bases that have no tests. This is also a pain the butt for prototyping and rapid application development. Right now we are creating dumby test files just to appease karma which is less than ideal. |
I wouldn't mind to take a shot at this. I guess a configuration option should be added to the runner and server (for singlerun). Any preferences on a name for this option? E.g. |
@budde377 that'd be great, yes the config name sounds good to me, I think it should default to |
@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 |
@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. |
@budde377 cheers thanks, guess it just missed it. I will await it in the next release :) |
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.
The text was updated successfully, but these errors were encountered: