Skip to content

Commit

Permalink
typo fix and name clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
nfriedly committed Oct 1, 2021
1 parent c60d6e7 commit 0889047
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/express-rate-limit-test.js
Expand Up @@ -642,8 +642,8 @@ describe("express-rate-limit node module", () => {
assert(errorCaught, "error should have been caught");
});

it("should handle two rate-limiters independtly", async () => {
const limiter = rateLimit({
it("should handle two rate-limiters independently", async () => {
const keyLimiter = rateLimit({
max: 2,
keyGenerator: function (req, res) {
assert.ok(req);
Expand All @@ -654,7 +654,7 @@ describe("express-rate-limit node module", () => {

return key;
},
requestPropertyName: "rateLimitIp",
requestPropertyName: "rateLimitKey",
handler: function (req, res) {
res.status(429).end("keyLimiter handler executed!");
},
Expand All @@ -671,7 +671,7 @@ describe("express-rate-limit node module", () => {
},
});

createAppWith([limiter, globalLimiter]);
createAppWith([keyLimiter, globalLimiter]);
await request(app).get("/").query({ key: 1 }).expect(200); // keyLimiter[1]: 1, keyLimiter[2]: 0, keyLimiter[3]: 0, global: 1
await request(app).get("/").query({ key: 2 }).expect(200); // keyLimiter[1]: 1, keyLimiter[2]: 1, keyLimiter[3]: 0, global: 2
await request(app).get("/").query({ key: 1 }).expect(200); // keyLimiter[1]: 2, keyLimiter[2]: 1, keyLimiter[3]: 0, global: 3
Expand Down

0 comments on commit 0889047

Please sign in to comment.