chore: replace calls to assertThrowsAsync with assertRejects (#12176)

This commit is contained in:
Casper Beyer 2021-09-22 21:21:11 +08:00 committed by GitHub
parent 82cfb46bd1
commit 20692f3e84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 113 additions and 134 deletions

View file

@ -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";
@ -162,7 +162,7 @@ unitTest(
const fromFilename = tempDir + "/from.txt";
const toFilename = tempDir + "/to.txt";
// We skip initial writing here, from.txt does not exist
await assertThrowsAsync(async () => {
await assertRejects(async () => {
await Deno.copyFile(fromFilename, toFilename);
}, Deno.errors.NotFound);
@ -192,7 +192,7 @@ unitTest(
unitTest(
{ perms: { read: false, write: true } },
async function copyFilePerm1() {
await assertThrowsAsync(async () => {
await assertRejects(async () => {
await Deno.copyFile("/from.txt", "/to.txt");
}, Deno.errors.PermissionDenied);
},
@ -201,7 +201,7 @@ unitTest(
unitTest(
{ perms: { read: true, write: false } },
async function copyFilePerm2() {
await assertThrowsAsync(async () => {
await assertRejects(async () => {
await Deno.copyFile("/from.txt", "/to.txt");
}, Deno.errors.PermissionDenied);
},