Skip to content

Commit

Permalink
🔬 test: Increase coverage of 1/2-failure rate-limiter test.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed May 21, 2024
1 parent 0bba5b5 commit 20ae46e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/api/rateLimit.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ server(__filename, () => {
.set('Accept', 'text/html')
.expect('Content-Type', 'text/html; charset=utf-8');

for (const i of range(2)) {
for (const i of range(4)) {
const isEven = i % 2 === 0;
const start = new Date();
const isFirst = i === 0;
if (!isFirst) {
Expand All @@ -320,7 +321,7 @@ server(__filename, () => {

assert.isAtMost(elapsed, duration * 1000);

if (isFirst) {
if (isEven) {
assert.equal(response.status, 200);
assert.equal(response.text, 'OK');
} else {
Expand Down

0 comments on commit 20ae46e

Please sign in to comment.