-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Print out warning in verbose & mini reporter when --fail-fast
is enabled
#1160
Conversation
You should pass the It'd be nice though if this wouldn't report when it knows no other tests didn't run. Which brings us back to the test counting logic. |
Thats a much better solution than what i did. Thanks, I'll try and make that change. You mentioned in the issue that it was probably hard or at least not a guarantee that we could determine the total amount of test to be run by the time failure occurred? So probably out of my league to fix that at this time. But maybe open that as a separate issue / feature request for after we can get this initial functionality in place? |
Updated PR to reflect change suggested by @novemberborn. FailFast is now passed into RunStatus. |
@@ -145,7 +145,8 @@ Api.prototype._run = function (files, options) { | |||
var runStatus = new RunStatus({ | |||
runOnlyExclusive: options.runOnlyExclusive, | |||
prefixTitles: this.options.explicitTitles || files.length > 1, | |||
base: path.relative('.', commonPathPrefix(files)) + path.sep | |||
base: path.relative('.', commonPathPrefix(files)) + path.sep, | |||
failFast: options.failFast |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use this.options.failFast
instead and you don't have to pass it on https://github.com/avajs/ava/pull/1160/files#diff-f8849ae9f0614ba9464fdd14c2d98dc0R163 as it's already passed in the API constructor.
Updated PR with your suggestions. Thanks for the assist 👍 |
@sindresorhus any thoughts on this? Happy to land this PR as-is and then do this as a follow-up. |
--fail-fast
is enabled
Looks great. Thanks for this excellent contribution @ThomasBem :) @novemberborn Can you open that follow-up issue you talked about? |
Thanks @ThomasBem! |
Hi there,
This PR fixes #1134. If --fail-fast is enabled it will print out the following message at the end of the report for both mini and verbose.
Mini:
Verbose:
This works for now, but i´m not sure if the way I have done it is the best.
I have been thinking that maybe instead of going through all the results in run-status looking for a stat element that has failFastEnabled=true.
It might be better to send a event or something if the Runner is created with the fail-fast option enabled. Then run-status could pickup on this and just set:
this.failFastEnabled = true
Let me know what you guys think!
Also i appreciate the support in the issue section helping me out with this :)