-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add failFast flag to abort test suite after first failure #387
Conversation
If a test fails, call the reporter#onRunComplete and exit the worker process Store startTime in `aggregatedResults` instead of runTime in order to calculate total runTime at any point in time after the test has begun
Extract redundancies in failure message and header creation Remove unused runTime variable in aggregatedResults
I like it! nit: can we call it |
Sure thing! I'll push the changes up soon |
this.log(failureMessage); | ||
} | ||
|
||
if (config.bail){ |
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.
nit: space before {
This is looks great, thanks. Let's fix the nits, and it's good to go. |
np. changes pushed |
@@ -62,6 +62,10 @@ function(config, testResult, aggregatedResults) { | |||
testRunTimeString = this._formatMsg(testRunTimeString, FAIL_COLOR); | |||
} | |||
|
|||
var resultHeader = this._getResultHeader(allTestsPassed, pathStr, [ | |||
testRunTimeString | |||
]); |
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.
I believe it should be:
var resultHeader = this._getResultHeader(allTestsPassed, pathStr, [
testRunTimeString
]);
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.
ah, right.
just pushed up the fix
Thanks! |
Add failFast flag to abort test suite after first failure
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Addresses issue #127 to add a flag to abort the test suite after the first failing test file occurs.
--bail
options or-b
alias.DefaultTestReporter
after calling the cleanup method
onRunComplete
in order to print the test results before abortaggregatedResults
. this allows us to calculate the runTime anywhereaggregatedResults
is available. I.e. to print the overall run time during any individual test, instead of after all the tests have run.I'm currently having an issue on jest 0.4.5 (from facebook/jest/master) that is forcing noHighlight to always be called. I believe its related to pull #364, but i'm unsure if this is a persistent issue or just my machine. Its happening by default and passing
--noHighlight false
does not remove it.Looking forward to your feedback! @amasad
examples:
Fail fast
Fail fast, verbose
Fail fast, no highlight