summaryrefslogtreecommitdiff
path: root/cli/tests/unit/fetch_test.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-06-02 14:24:44 +1000
committerGitHub <noreply@github.com>2020-06-02 00:24:44 -0400
commit3fe6bc1b82a10bed1d907b749b1cc200659df612 (patch)
tree02e14128039d015a7256494a50476f61785e6f33 /cli/tests/unit/fetch_test.ts
parent8b1b4766a1e747437a2b88fcadc26162a1bec640 (diff)
fix: Better use of @ts-expect-error (#6038)
Diffstat (limited to 'cli/tests/unit/fetch_test.ts')
-rw-r--r--cli/tests/unit/fetch_test.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts
index 554cf31e9..b95ecfb96 100644
--- a/cli/tests/unit/fetch_test.ts
+++ b/cli/tests/unit/fetch_test.ts
@@ -92,9 +92,8 @@ unitTest({ perms: { net: true } }, async function fetchBodyUsed(): Promise<
const response = await fetch("http://localhost:4545/cli/tests/fixture.json");
assertEquals(response.bodyUsed, false);
assertThrows((): void => {
- // Assigning to read-only property throws in the strict mode.
- // @ts-expect-error
- response.bodyUsed = true;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ (response as any).bodyUsed = true;
});
await response.blob();
assertEquals(response.bodyUsed, true);
@@ -657,10 +656,9 @@ unitTest({ perms: { net: true } }, async function fetchBodyReadTwice(): Promise<
assert(_json);
// All calls after the body was consumed, should fail
- const methods = ["json", "text", "formData", "arrayBuffer"];
+ const methods = ["json", "text", "formData", "arrayBuffer"] as const;
for (const method of methods) {
try {
- // @ts-expect-error
await response[method]();
fail(
"Reading body multiple times should failed, the stream should've been locked."