summaryrefslogtreecommitdiff
path: root/cli/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit')
-rw-r--r--cli/tests/unit/remove_test.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/cli/tests/unit/remove_test.ts b/cli/tests/unit/remove_test.ts
index 35e5c821e..5d293ec51 100644
--- a/cli/tests/unit/remove_test.ts
+++ b/cli/tests/unit/remove_test.ts
@@ -460,6 +460,31 @@ unitTest({ perms: { write: false } }, async function removeAllPerm(): Promise<
assertEquals(err.name, "PermissionDenied");
});
+unitTest(
+ {
+ ignore: Deno.build.os === "windows",
+ perms: { write: true, read: true },
+ },
+ async function removeUnixSocketSuccess(): Promise<void> {
+ for (const method of ["remove", "removeSync"] as const) {
+ // MAKE TEMPORARY UNIX SOCKET
+ const path = Deno.makeTempDirSync() + "/test.sock";
+ const listener = Deno.listen({ transport: "unix", path });
+ listener.close();
+ Deno.statSync(path); // check if unix socket exists
+
+ await Deno[method](path);
+ let err;
+ try {
+ Deno.statSync(path);
+ } catch (e) {
+ err = e;
+ }
+ assert(err instanceof Deno.errors.NotFound);
+ }
+ }
+);
+
if (Deno.build.os === "windows") {
unitTest(
{ perms: { run: true, write: true, read: true } },