Fix custom timeout specs for firefox
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
describe("Env integration", function() {
|
describe("Env integration", function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
jasmine.addMatchers({
|
jasmine.addMatchers({
|
||||||
toHaveFailedExpecationsForSuite: function(util, customeEqualityTesters) {
|
toHaveFailedExpecationsForRunnable: function(util, customeEqualityTesters) {
|
||||||
return {
|
return {
|
||||||
compare: function(actual, suiteName, expectedFailures) {
|
compare: function(actual, fullName, expectedFailures) {
|
||||||
var foundSuite = false, expectations = true, foundFailures = [];
|
var foundRunnable = false, expectations = true, foundFailures = [];
|
||||||
for (var i = 0; i < actual.calls.count(); i++) {
|
for (var i = 0; i < actual.calls.count(); i++) {
|
||||||
var args = actual.calls.argsFor(i)[0];
|
var args = actual.calls.argsFor(i)[0];
|
||||||
|
|
||||||
if (args.description === suiteName) {
|
if (args.fullName === fullName) {
|
||||||
foundSuite = true;
|
foundRunnable = true;
|
||||||
|
|
||||||
for (var j = 0; j < args.failedExpectations.length; j++) {
|
for (var j = 0; j < args.failedExpectations.length; j++) {
|
||||||
foundFailures.push(args.failedExpectations[j].message);
|
foundFailures.push(args.failedExpectations[j].message);
|
||||||
@@ -30,9 +30,9 @@ describe("Env integration", function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
pass: foundSuite && expectations,
|
pass: foundRunnable && expectations,
|
||||||
message: !foundSuite ? 'The suite "' + suiteName + '" never finished' :
|
message: !foundRunnable ? 'The runnable "' + fullName + '" never finished' :
|
||||||
'Expected suite "' + suiteName + '" to have failures ' + jasmine.pp(expectedFailures) + ' but it had ' + jasmine.pp(foundFailures)
|
'Expected runnable "' + fullName + '" to have failures ' + jasmine.pp(expectedFailures) + ' but it had ' + jasmine.pp(foundFailures)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -421,7 +421,7 @@ describe("Env integration", function() {
|
|||||||
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']);
|
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']);
|
||||||
|
|
||||||
reporter.jasmineDone.and.callFake(function() {
|
reporter.jasmineDone.and.callFake(function() {
|
||||||
expect(reporter.suiteDone).toHaveFailedExpecationsForSuite('my suite', [
|
expect(reporter.suiteDone).toHaveFailedExpecationsForRunnable('my suite', [
|
||||||
'Expected 1 to equal 2.',
|
'Expected 1 to equal 2.',
|
||||||
'Expected 2 to equal 3.'
|
'Expected 2 to equal 3.'
|
||||||
]);
|
]);
|
||||||
@@ -448,7 +448,7 @@ describe("Env integration", function() {
|
|||||||
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']);
|
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']);
|
||||||
|
|
||||||
reporter.jasmineDone.and.callFake(function() {
|
reporter.jasmineDone.and.callFake(function() {
|
||||||
expect(reporter.suiteDone).toHaveFailedExpecationsForSuite('outer suite', [
|
expect(reporter.suiteDone).toHaveFailedExpecationsForRunnable('outer suite', [
|
||||||
'Expected 1 to equal 2.',
|
'Expected 1 to equal 2.',
|
||||||
'Expected 2 to equal 3.'
|
'Expected 2 to equal 3.'
|
||||||
]);
|
]);
|
||||||
@@ -477,7 +477,7 @@ describe("Env integration", function() {
|
|||||||
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']);
|
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']);
|
||||||
|
|
||||||
reporter.jasmineDone.and.callFake(function() {
|
reporter.jasmineDone.and.callFake(function() {
|
||||||
expect(reporter.suiteDone).toHaveFailedExpecationsForSuite('my suite', [
|
expect(reporter.suiteDone).toHaveFailedExpecationsForRunnable('my suite', [
|
||||||
(/^Error: After All Exception/)
|
(/^Error: After All Exception/)
|
||||||
]);
|
]);
|
||||||
done();
|
done();
|
||||||
@@ -502,7 +502,7 @@ describe("Env integration", function() {
|
|||||||
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']);
|
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']);
|
||||||
|
|
||||||
reporter.jasmineDone.and.callFake(function() {
|
reporter.jasmineDone.and.callFake(function() {
|
||||||
expect(reporter.suiteDone).toHaveFailedExpecationsForSuite('my suite', [
|
expect(reporter.suiteDone).toHaveFailedExpecationsForRunnable('my suite', [
|
||||||
'Expected 1 to equal 2.'
|
'Expected 1 to equal 2.'
|
||||||
]);
|
]);
|
||||||
done();
|
done();
|
||||||
@@ -530,7 +530,7 @@ describe("Env integration", function() {
|
|||||||
|
|
||||||
|
|
||||||
reporter.jasmineDone.and.callFake(function() {
|
reporter.jasmineDone.and.callFake(function() {
|
||||||
expect(reporter.suiteDone).toHaveFailedExpecationsForSuite('my suite', [
|
expect(reporter.suiteDone).toHaveFailedExpecationsForRunnable('my suite', [
|
||||||
(/^Error: After All Exception/)
|
(/^Error: After All Exception/)
|
||||||
]);
|
]);
|
||||||
done();
|
done();
|
||||||
@@ -851,7 +851,7 @@ describe("Env integration", function() {
|
|||||||
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']);
|
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']);
|
||||||
|
|
||||||
reporter.jasmineDone.and.callFake(function() {
|
reporter.jasmineDone.and.callFake(function() {
|
||||||
expect(reporter.suiteDone).toHaveFailedExpecationsForSuite('my suite', [
|
expect(reporter.suiteDone).toHaveFailedExpecationsForRunnable('my suite', [
|
||||||
(/^Error: Timeout - Async callback was not invoked within timeout specified by jasmine\.DEFAULT_TIMEOUT_INTERVAL\./)
|
(/^Error: Timeout - Async callback was not invoked within timeout specified by jasmine\.DEFAULT_TIMEOUT_INTERVAL\./)
|
||||||
]);
|
]);
|
||||||
done();
|
done();
|
||||||
@@ -878,40 +878,25 @@ describe("Env integration", function() {
|
|||||||
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone', 'suiteDone', 'specDone']);
|
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone', 'suiteDone', 'specDone']);
|
||||||
|
|
||||||
reporter.jasmineDone.and.callFake(function() {
|
reporter.jasmineDone.and.callFake(function() {
|
||||||
expect(reporter.specDone).toHaveBeenCalledWith(jasmine.objectContaining({
|
expect(reporter.specDone).toHaveFailedExpecationsForRunnable('suite beforeAll times out', [
|
||||||
fullName: 'suite beforeAll times out',
|
(/^Error: Timeout - Async callback was not invoked within timeout specified by jasmine\.DEFAULT_TIMEOUT_INTERVAL\./)
|
||||||
failedExpectations: [jasmine.objectContaining({
|
]);
|
||||||
message: 'Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.'
|
|
||||||
})]
|
|
||||||
}));
|
|
||||||
|
|
||||||
expect(reporter.suiteDone).toHaveBeenCalledWith(jasmine.objectContaining({
|
expect(reporter.suiteDone).toHaveFailedExpecationsForRunnable('suite afterAll', [
|
||||||
fullName: 'suite afterAll',
|
(/^Error: Timeout - Async callback was not invoked within timeout specified by jasmine\.DEFAULT_TIMEOUT_INTERVAL\./)
|
||||||
failedExpectations: [jasmine.objectContaining({
|
]);
|
||||||
message: 'Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.'
|
|
||||||
})]
|
|
||||||
}));
|
|
||||||
|
|
||||||
expect(reporter.specDone).toHaveBeenCalledWith(jasmine.objectContaining({
|
expect(reporter.specDone).toHaveFailedExpecationsForRunnable('suite beforeEach times out', [
|
||||||
fullName: 'suite beforeEach times out',
|
(/^Error: Timeout - Async callback was not invoked within timeout specified by jasmine\.DEFAULT_TIMEOUT_INTERVAL\./)
|
||||||
failedExpectations: [jasmine.objectContaining({
|
]);
|
||||||
message: 'Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.'
|
|
||||||
})]
|
|
||||||
}));
|
|
||||||
|
|
||||||
expect(reporter.specDone).toHaveBeenCalledWith(jasmine.objectContaining({
|
expect(reporter.specDone).toHaveFailedExpecationsForRunnable('suite afterEach times out', [
|
||||||
fullName: 'suite afterEach times out',
|
(/^Error: Timeout - Async callback was not invoked within timeout specified by jasmine\.DEFAULT_TIMEOUT_INTERVAL\./)
|
||||||
failedExpectations: [jasmine.objectContaining({
|
]);
|
||||||
message: 'Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.'
|
|
||||||
})]
|
|
||||||
}));
|
|
||||||
|
|
||||||
expect(reporter.specDone).toHaveBeenCalledWith(jasmine.objectContaining({
|
expect(reporter.specDone).toHaveFailedExpecationsForRunnable('suite it times out', [
|
||||||
fullName: 'suite it times out',
|
(/^Error: Timeout - Async callback was not invoked within timeout specified by jasmine\.DEFAULT_TIMEOUT_INTERVAL\./)
|
||||||
failedExpectations: [jasmine.objectContaining({
|
]);
|
||||||
message: 'Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.'
|
|
||||||
})]
|
|
||||||
}));
|
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user