diff options
author | Casper Beyer <caspervonb@pm.me> | 2020-06-25 06:57:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 00:57:08 +0200 |
commit | 87f8f99c49e62c06f85bb453a7c12b32634c3bef (patch) | |
tree | e8f966f981a9f825ca1f22fe8d39642c448a9c62 /cli/tests/unit/resources_test.ts | |
parent | 6bbe52fba33e440e113bca423b5eae0d1f320c49 (diff) |
refactor(cli/tests/unit) to use assertThrows (#6459)
Diffstat (limited to 'cli/tests/unit/resources_test.ts')
-rw-r--r-- | cli/tests/unit/resources_test.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/cli/tests/unit/resources_test.ts b/cli/tests/unit/resources_test.ts index 385905a6e..e4d420055 100644 --- a/cli/tests/unit/resources_test.ts +++ b/cli/tests/unit/resources_test.ts @@ -1,14 +1,10 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { unitTest, assertEquals, assert } from "./test_util.ts"; +import { unitTest, assertEquals, assert, assertThrows } from "./test_util.ts"; unitTest(function resourcesCloseBadArgs(): void { - let err; - try { + assertThrows(() => { Deno.close((null as unknown) as number); - } catch (e) { - err = e; - } - assert(err instanceof Deno.errors.InvalidData); + }, Deno.errors.InvalidData); }); unitTest(function resourcesStdio(): void { |