summaryrefslogtreecommitdiff
path: root/cli/tests/unit/stat_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/stat_test.ts')
-rw-r--r--cli/tests/unit/stat_test.ts34
1 files changed, 24 insertions, 10 deletions
diff --git a/cli/tests/unit/stat_test.ts b/cli/tests/unit/stat_test.ts
index 362899128..eefbab2c5 100644
--- a/cli/tests/unit/stat_test.ts
+++ b/cli/tests/unit/stat_test.ts
@@ -108,9 +108,13 @@ unitTest({ permissions: { read: false } }, function statSyncPerm() {
});
unitTest({ permissions: { read: true } }, function statSyncNotFound() {
- assertThrows(() => {
- Deno.statSync("bad_file_name");
- }, Deno.errors.NotFound);
+ assertThrows(
+ () => {
+ Deno.statSync("bad_file_name");
+ },
+ Deno.errors.NotFound,
+ `stat 'bad_file_name'`,
+ );
});
unitTest({ permissions: { read: true } }, function lstatSyncSuccess() {
@@ -148,9 +152,13 @@ unitTest({ permissions: { read: false } }, function lstatSyncPerm() {
});
unitTest({ permissions: { read: true } }, function lstatSyncNotFound() {
- assertThrows(() => {
- Deno.lstatSync("bad_file_name");
- }, Deno.errors.NotFound);
+ assertThrows(
+ () => {
+ Deno.lstatSync("bad_file_name");
+ },
+ Deno.errors.NotFound,
+ `stat 'bad_file_name'`,
+ );
});
unitTest(
@@ -228,8 +236,10 @@ unitTest({ permissions: { read: false } }, async function statPerm() {
unitTest({ permissions: { read: true } }, async function statNotFound() {
await assertRejects(
async () => {
- await Deno.stat("bad_file_name"), Deno.errors.NotFound;
+ await Deno.stat("bad_file_name");
},
+ Deno.errors.NotFound,
+ `stat 'bad_file_name'`,
);
});
@@ -268,9 +278,13 @@ unitTest({ permissions: { read: false } }, async function lstatPerm() {
});
unitTest({ permissions: { read: true } }, async function lstatNotFound() {
- await assertRejects(async () => {
- await Deno.lstat("bad_file_name");
- }, Deno.errors.NotFound);
+ await assertRejects(
+ async () => {
+ await Deno.lstat("bad_file_name");
+ },
+ Deno.errors.NotFound,
+ `stat 'bad_file_name'`,
+ );
});
unitTest(