Skip to content

Commit

Permalink
fix(jasmine): support jasmine >3.6.2 (#2594)
Browse files Browse the repository at this point in the history
Correctly handle async errors from `jasmine.execute` (returns a never resolving promise since jasmine 3.6.2)
  • Loading branch information
nicojs committed Jan 15, 2021
1 parent 04cf519 commit 582079b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 56 deletions.
61 changes: 8 additions & 53 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion e2e/package.json
Expand Up @@ -16,7 +16,7 @@
"chai-as-promised": "~7.1.1",
"cross-env": "~5.2.0",
"grunt": "~1.0.4",
"jasmine": "~3.6.1",
"jasmine": "~3.6.2",
"jasmine-core": "~3.6.0",
"jest": "~26.4.2",
"jest-environment-jsdom-sixteen": "^1.0.3",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -29,7 +29,7 @@
"execa": "~5.0.0",
"glob": "~7.1.1",
"install-local": "^3.0.1",
"jasmine": "3.6.1",
"jasmine": "~3.6.2",
"jasmine-core": "~3.6.0",
"json-schema-to-typescript": "~10.1.0",
"lerna": "~3.22.1",
Expand Down
7 changes: 6 additions & 1 deletion packages/jasmine-runner/src/jasmine-test-runner.ts
Expand Up @@ -97,7 +97,12 @@ export class JasmineTestRunner implements TestRunner {
};

jasmine.env.addReporter(reporter);
jasmine.execute();
const maybePromise = jasmine.execute();
if (maybePromise) {
maybePromise.catch((err) => {
runTask.reject(err);
});
}
const result = await runTask.promise;
return result;
} catch (error) {
Expand Down

0 comments on commit 582079b

Please sign in to comment.