diff options
Diffstat (limited to 'cli/tests/unit/write_file_test.ts')
-rw-r--r-- | cli/tests/unit/write_file_test.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/tests/unit/write_file_test.ts b/cli/tests/unit/write_file_test.ts index c4c437708..265edbd95 100644 --- a/cli/tests/unit/write_file_test.ts +++ b/cli/tests/unit/write_file_test.ts @@ -1,8 +1,8 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. import { assertEquals, + assertRejects, assertThrows, - assertThrowsAsync, unitTest, } from "./test_util.ts"; @@ -160,7 +160,7 @@ unitTest( const data = enc.encode("Hello"); const filename = "/baddir/test.txt"; // The following should fail because /baddir doesn't exist (hopefully). - await assertThrowsAsync(async () => { + await assertRejects(async () => { await Deno.writeFile(filename, data); }, Deno.errors.NotFound); }, @@ -173,7 +173,7 @@ unitTest( const data = enc.encode("Hello"); const filename = "/baddir/test.txt"; // The following should fail due to no write permission - await assertThrowsAsync(async () => { + await assertRejects(async () => { await Deno.writeFile(filename, data); }, Deno.errors.PermissionDenied); }, @@ -201,7 +201,7 @@ unitTest( const data = enc.encode("Hello"); const filename = Deno.makeTempDirSync() + "/test.txt"; // if create turned off, the file won't be created - await assertThrowsAsync(async () => { + await assertRejects(async () => { await Deno.writeFile(filename, data, { create: false }); }, Deno.errors.NotFound); |