Fixed global error handler stack corruption in Jasmine's own tests

This commit is contained in:
Steve Gravrock
2020-09-02 09:31:35 -07:00
parent 5a715aecee
commit 00feef8632
14 changed files with 833 additions and 985 deletions

View File

@@ -37,9 +37,9 @@ describe("Custom Matchers (Integration)", function () {
expect(firstSpecResult.failedExpectations[0].message).toEqual("matcherForSpec: actual: zzz; expected: yyy");
done();
};
env.addReporter({ specDone:specDoneSpy, jasmineDone: expectations});
env.addReporter({ specDone:specDoneSpy });
env.execute();
env.execute(null, expectations);
});
it("passes the spec if the custom matcher passes", function(done) {
@@ -57,8 +57,8 @@ describe("Custom Matchers (Integration)", function () {
expect(result.status).toEqual('passed');
};
env.addReporter({ specDone: specExpectations, jasmineDone: done });
env.execute();
env.addReporter({ specDone: specExpectations });
env.execute(null, done);
});
it("passes the spec if the custom equality matcher passes for types nested inside asymmetric equality testers", function(done) {
@@ -81,8 +81,8 @@ describe("Custom Matchers (Integration)", function () {
expect(result.status).toEqual('passed');
};
env.addReporter({ specDone: specExpectations, jasmineDone: done });
env.execute();
env.addReporter({ specDone: specExpectations });
env.execute(null, done);
});
it("supports asymmetric equality testers that take a list of custom equality testers", function(done) {
@@ -111,8 +111,8 @@ describe("Custom Matchers (Integration)", function () {
expect(result.status).toEqual('passed');
};
env.addReporter({ specDone: specExpectations, jasmineDone: done });
env.execute();
env.addReporter({ specDone: specExpectations });
env.execute(null, done);
});
it("displays an appropriate failure message if a custom equality matcher fails", function(done) {
@@ -135,8 +135,8 @@ describe("Custom Matchers (Integration)", function () {
);
};
env.addReporter({ specDone: specExpectations, jasmineDone: done });
env.execute();
env.addReporter({ specDone: specExpectations });
env.execute(null, done);
});
it("uses the negative compare function for a negative comparison, if provided", function(done) {
@@ -157,8 +157,8 @@ describe("Custom Matchers (Integration)", function () {
expect(result.status).toEqual('passed');
};
env.addReporter({ specDone: specExpectations, jasmineDone: done });
env.execute();
env.addReporter({ specDone: specExpectations });
env.execute(null, done);
});
it("generates messages with the same rules as built in matchers absent a custom message", function(done) {
@@ -180,8 +180,8 @@ describe("Custom Matchers (Integration)", function () {
expect(result.failedExpectations[0].message).toEqual("Expected 'a' to be real.");
};
env.addReporter({ specDone: specExpectations, jasmineDone: done });
env.execute();
env.addReporter({ specDone: specExpectations });
env.execute(null, done);
});
it("passes the expected and actual arguments to the comparison function", function(done) {
@@ -205,8 +205,8 @@ describe("Custom Matchers (Integration)", function () {
expect(argumentSpy).toHaveBeenCalledWith(true, "arg1", "arg2");
};
env.addReporter({ specDone: specExpectations, jasmineDone: done });
env.execute();
env.addReporter({ specDone: specExpectations });
env.execute(null, done);
});
// TODO: remove this in the next major release.
@@ -232,8 +232,8 @@ describe("Custom Matchers (Integration)", function () {
);
};
env.addReporter({ specDone: specExpectations, jasmineDone: done });
env.execute();
env.addReporter({ specDone: specExpectations });
env.execute(null, done);
});
it("provides custom equality testers to the matcher factory via matchersUtil", function (done) {
@@ -262,7 +262,7 @@ describe("Custom Matchers (Integration)", function () {
expect(result.failedExpectations).toEqual([]);
};
env.addReporter({specDone: specExpectations, jasmineDone: done});
env.execute();
env.addReporter({specDone: specExpectations});
env.execute(null, done);
});
});