Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Arora committed Jun 27, 2020
1 parent e5aba75 commit 71c7ce9
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions test/strategy.js
Expand Up @@ -7,7 +7,7 @@ const chai = require("chai"),
expect = chai.expect,
strategyConfig = {
region: "us-east-1",
cognitoUserPoolId: "us-east-1_dXlFef73t",
cognitoUserPoolId: "us-east-1_PNBFQ9W7X",
tokenUse: "access", //Possible Values: access | id
tokenExpiration: 3600000 //Up to default expiration of 1 hour (4000 ms)
},
Expand All @@ -30,7 +30,7 @@ describe("Strategy Negative Scenarios", () => {
expect(function() {
new Strategy({
region: "us-east-1",
cognitoUserPoolId: "us-east-1_dXlFef73t",
cognitoUserPoolId: "us-east-1_PNBFQ9W7X",
tokenExpiration: 3600000 //Up to default expiration of 1 hour (4000 ms)
});
}).to.throw(
Expand All @@ -44,7 +44,7 @@ describe("Strategy Negative Scenarios", () => {
new Strategy({
region: "us-east-1",
tokenUse: "hello", //Possible Values: access | id
cognitoUserPoolId: "us-east-1_dXlFef73t",
cognitoUserPoolId: "us-east-1_PNBFQ9W7X",
tokenExpiration: 3600000 //Up to default expiration of 1 hour (4000 ms)
});
}).to.throw(
Expand All @@ -69,7 +69,7 @@ describe("Strategy Negative Scenarios", () => {
it("should not have Region undefined", function() {
expect(function() {
new Strategy({
cognitoUserPoolId: "us-east-1_dXlFef73t",
cognitoUserPoolId: "us-east-1_PNBFQ9W7X",
tokenUse: "access", //Possible Values: access | id
tokenExpiration: 3600000 //Up to default expiration of 1 hour (4000 ms)
});
Expand Down Expand Up @@ -128,13 +128,4 @@ describe("Strategy Positive Scenarios", () => {
};
});
});


it("should check if Validate function can execute successfully by detecting an expired token", async () => {
await strategy.init(callback => {
strategy.validate(token, function(err, response) {
expect(err.name).to.eql("TokenExpiredError");
});
});
});
});

0 comments on commit 71c7ce9

Please sign in to comment.