Check afterAll failure messages with regexp, since some browsers add more info

This commit is contained in:
slackersoft
2014-09-04 08:06:24 -07:00
parent 9402d59859
commit 137c1a39f6

View File

@@ -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();
});
@@ -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();
});
@@ -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();
});