diff options
Diffstat (limited to 'cli/tests/unit/remove_test.ts')
-rw-r--r-- | cli/tests/unit/remove_test.ts | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/cli/tests/unit/remove_test.ts b/cli/tests/unit/remove_test.ts index 192ac676e..5ea265ea8 100644 --- a/cli/tests/unit/remove_test.ts +++ b/cli/tests/unit/remove_test.ts @@ -80,15 +80,23 @@ unitTest( const subPathInfo = Deno.statSync(subPath); assert(subPathInfo.isDirectory); // check exist first - await assertRejects(async () => { - await Deno[method](path); - }, Error); + await assertRejects( + async () => { + await Deno[method](path); + }, + Error, + `remove '${path}'`, + ); // TODO(ry) Is Other really the error we should get here? What would Go do? // NON-EXISTENT DIRECTORY/FILE - await assertRejects(async () => { - await Deno[method]("/baddir"); - }, Deno.errors.NotFound); + await assertRejects( + async () => { + await Deno[method]("/baddir"); + }, + Deno.errors.NotFound, + `remove '/baddir'`, + ); } }, ); @@ -210,10 +218,14 @@ unitTest( unitTest({ permissions: { write: true } }, async function removeAllFail() { for (const method of REMOVE_METHODS) { // NON-EXISTENT DIRECTORY/FILE - await assertRejects(async () => { - // Non-existent - await Deno[method]("/baddir", { recursive: true }); - }, Deno.errors.NotFound); + await assertRejects( + async () => { + // Non-existent + await Deno[method]("/baddir", { recursive: true }); + }, + Deno.errors.NotFound, + `remove '/baddir'`, + ); } }); |