Skip to content
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

feat: Propagate errors thrown in afterAll blocks #162

Merged
merged 1 commit into from
Mar 29, 2017

Conversation

TheModMaker
Copy link
Contributor

If an error is thrown in an afterAll block, it needs to be handled
specially since the error isn't attached to a specific spec. This
change won't fail any specific test, but will cause a general failure
which will still cause overall run failure.

Closes #161

src/adapter.js Outdated
@@ -191,6 +191,18 @@ function KarmaReporter (tc, jasmineEnv) {

this.jasmineDone = function (result) {
result = result || {}

// Any errors in top-level afterAll blocks are given here.
if (result.failedExpectations && result.failedExpectations.length) {
Copy link
Contributor

@maksimr maksimr Mar 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Only one note - extract the code to a function and remove duplication between jasmineDone and suiteDone

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

If an error is thrown in an afterAll block, it needs to be handled
specially since the error isn't attached to a specific spec.  This
change won't fail any specific test, but will cause a general failure
which will still cause overall run failure.

Closes karma-runner#161
@TheModMaker TheModMaker force-pushed the feat-afterAllErrors branch from e5fc540 to f3fa264 Compare March 29, 2017 16:49
@maksimr maksimr merged commit 372adb9 into karma-runner:master Mar 29, 2017
@TheModMaker TheModMaker deleted the feat-afterAllErrors branch March 29, 2017 18:15
@aleitamar
Copy link

@maksimr @dignifiedquire
When are you planning to release this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants