summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
authorKevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com>2020-05-14 03:59:56 -0700
committerGitHub <noreply@github.com>2020-05-14 06:59:56 -0400
commit7de86ab605ee94fdbce351c7f3031816c935c393 (patch)
treef0158fed6a17998c78c962696c886d860f628f88 /cli/js
parent21a4e9cc58aeed55cb597d2f986cca56f0aec819 (diff)
cli: don't panic on Deno.close invalid argument (#5320)
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/tests/resources_test.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/js/tests/resources_test.ts b/cli/js/tests/resources_test.ts
index 680fac8b7..385905a6e 100644
--- a/cli/js/tests/resources_test.ts
+++ b/cli/js/tests/resources_test.ts
@@ -1,6 +1,16 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { unitTest, assertEquals, assert } from "./test_util.ts";
+unitTest(function resourcesCloseBadArgs(): void {
+ let err;
+ try {
+ Deno.close((null as unknown) as number);
+ } catch (e) {
+ err = e;
+ }
+ assert(err instanceof Deno.errors.InvalidData);
+});
+
unitTest(function resourcesStdio(): void {
const res = Deno.resources();