mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
chore: replace calls to assertThrowsAsync with assertRejects (#12176)
This commit is contained in:
parent
82cfb46bd1
commit
20692f3e84
25 changed files with 113 additions and 134 deletions
|
@ -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);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue