Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nickiepucel committed Mar 26, 2021
1 parent f0a7f84 commit 6405dc8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/test-signatures.spec.ts
Expand Up @@ -25,7 +25,7 @@ describe("Signatures", function () {

//== Run the test in `func`
await assert.rejects(samlObj.validatePostResponseAsync(samlResponseBody), {
message: shouldErrorWith || "SAML assertion expired",
message: shouldErrorWith || "SAML assertion expired: clocks skewed too much",
});
//== Assert times `validateSignature` was called
validateSignatureSpy.callCount.should.eql(amountOfSignatureChecks);
Expand Down
8 changes: 4 additions & 4 deletions test/tests.spec.ts
Expand Up @@ -1610,7 +1610,7 @@ describe("passport-saml /", function () {
fakeClock.restore();
fakeClock = sinon.useFakeTimers(Date.parse("2014-05-28T00:19:08Z"));
await assert.rejects(samlObj.validatePostResponseAsync(container), {
message: "SAML assertion expired",
message: "SAML assertion expired: clocks skewed too much",
});
});

Expand All @@ -1629,7 +1629,7 @@ describe("passport-saml /", function () {
fakeClock.restore();
fakeClock = sinon.useFakeTimers(Date.parse("2014-05-28T00:19:09Z"));
await assert.rejects(samlObj.validatePostResponseAsync(container), {
message: "SAML assertion expired",
message: "SAML assertion expired: clocks skewed too much",
});
});

Expand Down Expand Up @@ -1677,7 +1677,7 @@ describe("passport-saml /", function () {
fakeClock.restore();
fakeClock = sinon.useFakeTimers(Date.parse("2014-05-28T00:17:09Z"));
await assert.rejects(samlObj.validatePostResponseAsync(container), {
message: "SAML assertion expired",
message: "SAML assertion expired: assertion too old",
});
});

Expand Down Expand Up @@ -2013,7 +2013,7 @@ describe("validateRedirect()", function () {

await assert.rejects(
samlObj.validateRedirectAsync(this.request, this.request.originalQuery),
{ message: "SAML assertion expired" }
{ message: "SAML assertion expired: clocks skewed too much" }
);
});
it("errors if request has a bad signature", async function () {
Expand Down

0 comments on commit 6405dc8

Please sign in to comment.