Skip to content
Permalink
Browse files
fix(jasmine): Scenarios failed due to an AssertionError are marked as…
… such
  • Loading branch information
jan-molak committed Nov 24, 2019
1 parent 525dec7 commit da3eaa35d93bfd67730a567050b5483f92d89cca
Showing with 6 additions and 0 deletions.
  1. +6 −0 packages/jasmine/src/SerenityReporterForJasmine.ts
@@ -180,6 +180,12 @@ export class SerenityReporterForJasmine {
? ErrorSerialiser.deserialiseFromStackTrace(failure.stack)
: new Error(failure.message);

if (cause instanceof AssertionError) {
// sadly, Jasmine error propagation mechanism is rather basic
// and unable to serialise the expected/actual properties of the error
return new ExecutionFailedWithAssertionError(cause);
}

if (!! failure.matcherName) { // the presence of a non-empty matcherName property indicates an assertion error
return new ExecutionFailedWithAssertionError(
new AssertionError(failure.message, failure.expected, failure.actual, cause),

0 comments on commit da3eaa3

Please sign in to comment.