Skip to content
Permalink
Browse files
fix(jasmine): ensure async events are correctly synchronised before t…
…he test run finishes

SerenityBDDReporter emits reports after the test run completes

#405
  • Loading branch information
jan-molak committed Jan 23, 2020
1 parent d69aeae commit 9b4e49ade65df6d73421e837229ca5c785b677e0
Showing with 6 additions and 3 deletions.
  1. +2 −2 packages/jasmine/spec/SerenityReporterForJasmine.spec.ts
  2. +4 −1 packages/jasmine/src/SerenityReporterForJasmine.ts
@@ -48,8 +48,8 @@ describe('SerenityReporterForJasmine', () => {

describe('the test run', () => {
/** @test {SerenityReporterForJasmine#jasmineDone} */
it('ends', () => {
reporter.jasmineDone({
it('ends', async () => {
await reporter.jasmineDone({
overallStatus: 'passed',
incompleteReason: undefined,
order: {
@@ -104,7 +104,10 @@ export class SerenityReporterForJasmine {
* @param {JasmineDoneInfo} suiteInfo
*/
jasmineDone(suiteInfo: JasmineDoneInfo) {
this.emit(new TestRunFinished(this.serenity.currentTime()));
return this.serenity.waitForNextCue()
.then(() => {
this.emit(new TestRunFinished(this.serenity.currentTime()));
});
}

/**

0 comments on commit 9b4e49a

Please sign in to comment.