karma-jasmine
karma-jasmine copied to clipboard
afterAll support is not released.
I started to open a bug and PR to support error reporting in afterAll functions. But as I looked for how to add a test for this I discovered there already was a test, and the feature is already implemented in PR #162 in March. But there feature never made it into a release.
The last release seems to be v1.1.0 eight months ago.
Is anyone looking at this?
I'm not sure if this is the correct place to post - But with this change (although perhaps before as well) the "suites" property is null on a second call to onBrowserComplete() in webapp/node_modules/karma-testng-reporter/index.js (after onRunComplete() - which sets it to null - has been called). In the first call "suites" was still set and the call succeeded. I don't know why there is a second call. Also - I noticed an earlier error message "An error was thrown in afterAll\nTypeError: 'undefined' is not an object (evaluating 'children[0].result')"
And a recent update to Karma described as " Propagate errors thrown in afterAll blocks (f3fa264), closes [#161](https://git hub.com/karma-runner/karma-jasmine/issues/161)". I am wondering if the collected and propagated error results in a second call to onBrowserComplete() that occurs after onRunComplete() has been called?
I have noticed an issue with that solution it can obscure errors in such way you don't have any idea where it was thrown: https://github.com/TheModMaker/karma-jasmine/commit/f3fa264107cb5695ee0f906895a204c9d0efdd13#diff-e52a9a67956bd51d044af4058fb939ceR176
We are seeing the same issue with error propagation in our tests as @Xesenix in the latest version (v2.0.1), which, I'm sure you can appreciate makes it extremely difficult to fix failing tests.
@maksimr / @TheModMaker Any chance you guys could take a look as it seems to relate to a commit that you worked on together?