Skip to content

Commit

Permalink
Check afterAll failure messages with regexp, since some browsers add …
Browse files Browse the repository at this point in the history
…more info
  • Loading branch information
slackersoft committed Sep 4, 2014
1 parent 9402d59 commit 137c1a3
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions spec/core/integration/EnvSpec.js
Expand Up @@ -383,11 +383,19 @@ describe("Env integration", function() {
matcherName : '',
expected : '',
actual : '',
message : 'Error: After All Exception',
message : jasmine.any(String),
stack : jasmine.any(String),
passed: false
}]
}));

for (var i = 0; i < reporter.suiteDone.calls.count(); i++) {
var args = reporter.suiteDone.calls.argsFor(i);
if (args.description === 'my suite') {
expect(args.failedExpectations[0].message).toMatch(/^Error: After All Exception/);
}
}

done();
});

Expand Down Expand Up @@ -451,11 +459,19 @@ describe("Env integration", function() {
matcherName : '',
expected : '',
actual : '',
message : 'Error: After All Exception',
message : jasmine.any(String),
stack : jasmine.any(String),
passed: false
}]
}));

for (var i = 0; i < reporter.suiteDone.calls.count(); i++) {
var args = reporter.suiteDone.calls.argsFor(i);
if (args.description === 'my suite') {
expect(args.failedExpectations[0].message).toMatch(/^Error: After All Exception/);
}
}

done();
});

Expand Down Expand Up @@ -765,15 +781,16 @@ describe("Env integration", function() {

reporter.jasmineDone.and.callFake(function() {
expect(reporter.suiteDone).toHaveBeenCalledWith(jasmine.objectContaining({
failedExpectations: [{
matcherName : '',
expected : '',
actual : '',
message : 'Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.',
stack : jasmine.any(String),
passed: false
}]
description: 'my suite',
}));

for (var i = 0; i < reporter.suiteDone.calls.count(); i++) {
var args = reporter.suiteDone.calls.argsFor(i);
if (args.description === 'my suite') {
expect(args.failedExpectations[0].message).toMatch(/^Error: Timeout - Async callback was not invoked within timeout specified by jasmine\.DEFAULT_TIMEOUT_INTERVAL\./);
}
}

done();
});

Expand Down

0 comments on commit 137c1a3

Please sign in to comment.