Skip to content

Commit 4c6a27e

Browse files
committed
test update for vitest 3
1 parent 5c71ccb commit 4c6a27e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/basic.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('shield', async () => {
3737
try {
3838
// req.count = 3
3939
// as limit.max = 2, this should throw 429 and ban for 3 seconds (limit.ban)
40-
expect(async () =>
40+
await expect(async () =>
4141
$fetch('/api/basicexample?c=1/3', { method: 'GET', retryStatusCodes: [] }),
4242
).rejects.toThrowError()
4343
}
@@ -70,7 +70,7 @@ describe('shield', async () => {
7070
await $fetch('/api/basicexample?c=3/2', { method: 'GET', retryStatusCodes: [] }) // req.count = 2
7171
try {
7272
// req.count = 3
73-
expect(async () =>
73+
await expect(async () =>
7474
$fetch('/api/basicexample?c=3/3', { method: 'GET', retryStatusCodes: [] }),
7575
).rejects.toThrowError()
7676
}

test/withroutes.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('shield with /api/v3 route', async () => {
3434
try {
3535
// req.count = 3
3636
// as limit.max = 2, this should throw 429 and ban for 3 seconds (limit.ban)
37-
expect(async () =>
37+
await expect(async () =>
3838
$fetch('/api/v3/example?c=1/3', { method: 'GET', retryStatusCodes: [] }),
3939
).rejects.toThrowError()
4040
}

0 commit comments

Comments
 (0)