summaryrefslogtreecommitdiff
path: root/cli/tests/unit/dispatch_json_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/dispatch_json_test.ts
parent8b1b4766a1e747437a2b88fcadc26162a1bec640 (diff)
fix: Better use of @ts-expect-error (#6038)
Diffstat (limited to 'cli/tests/unit/dispatch_json_test.ts')
-rw-r--r--cli/tests/unit/dispatch_json_test.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/cli/tests/unit/dispatch_json_test.ts b/cli/tests/unit/dispatch_json_test.ts
index 51c33befd..ebb8217e3 100644
--- a/cli/tests/unit/dispatch_json_test.ts
+++ b/cli/tests/unit/dispatch_json_test.ts
@@ -19,14 +19,19 @@ unitTest(
}
);
+/* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/no-explicit-any,no-var */
+declare global {
+ namespace Deno {
+ var core: any;
+ }
+}
+/* eslint-enable */
+
unitTest(function malformedJsonControlBuffer(): void {
- // @ts-expect-error
const opId = Deno.core.ops()["op_open"];
- // @ts-expect-error
const res = Deno.core.send(opId, new Uint8Array([1, 2, 3, 4, 5]));
const resText = new TextDecoder().decode(res);
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const resJson = JSON.parse(resText) as any;
+ const resJson = JSON.parse(resText);
assert(!resJson.ok);
assert(resJson.err);
});