Skip to content

Commit 106a3e5

Browse files
committed
chore test wait moved up
1 parent b90b5a1 commit 106a3e5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/basic.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,16 @@ describe("shield", async () => {
4949
});
5050

5151
it("respond to the 2nd api call when more then limit.duration time passes", async () => {
52+
// here we should wait for the 3 sec ban to expire
53+
await new Promise((resolve) => setTimeout(resolve, (nuxtConfigBan + 1) * 1000));
54+
5255
// see #13
5356
// req.count = 1
5457
let response = await $fetch("/api/example?c=2/1", {
5558
method: "GET",
5659
retryStatusCodes: [],
5760
});
5861

59-
await new Promise((resolve) =>
60-
setTimeout(resolve, (nuxtConfigDuration + 1) * 1000)
61-
);
62-
6362
// req.count = 2
6463
response = await $fetch("/api/example?c=2/2", {
6564
method: "GET",

0 commit comments

Comments
 (0)