mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
chore(ext/http): fix a rejection test (#20514)
Use `assertRejects` to actually catch errors.
This commit is contained in:
parent
71af3c375c
commit
d226970c0e
1 changed files with 3 additions and 6 deletions
|
@ -967,12 +967,9 @@ function createStreamTest(count: number, delay: number, action: string) {
|
|||
await listeningPromise;
|
||||
const resp = await fetch(`http://127.0.0.1:${servePort}/`);
|
||||
if (action == "Throw") {
|
||||
try {
|
||||
await assertRejects(async () => {
|
||||
await resp.text();
|
||||
fail();
|
||||
} catch (_) {
|
||||
// expected
|
||||
}
|
||||
});
|
||||
} else {
|
||||
const text = await resp.text();
|
||||
|
||||
|
@ -985,7 +982,7 @@ function createStreamTest(count: number, delay: number, action: string) {
|
|||
}
|
||||
} finally {
|
||||
ac.abort();
|
||||
await server.finished;
|
||||
await server.shutdown();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue