summaryrefslogtreecommitdiff
path: root/cli/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit')
-rw-r--r--cli/tests/unit/net_test.ts31
1 files changed, 2 insertions, 29 deletions
diff --git a/cli/tests/unit/net_test.ts b/cli/tests/unit/net_test.ts
index e1a050c73..99af959cc 100644
--- a/cli/tests/unit/net_test.ts
+++ b/cli/tests/unit/net_test.ts
@@ -515,8 +515,6 @@ unitTest(
unitTest(
{
- // FIXME(bartlomieju)
- ignore: true,
perms: { net: true },
},
async function netCloseWriteSuccess() {
@@ -537,36 +535,11 @@ unitTest(
assertEquals(1, buf[0]);
assertEquals(2, buf[1]);
assertEquals(3, buf[2]);
- // Check write should be closed
+ // Verify that the write end of the socket is closed.
+ // TODO(piscisaureus): assert that thrown error is of a specific type.
await assertThrowsAsync(async () => {
await conn.write(new Uint8Array([1, 2, 3]));
- }, Deno.errors.BrokenPipe);
- closeDeferred.resolve();
- listener.close();
- conn.close();
- },
-);
-
-unitTest(
- {
- // FIXME(bartlomieju)
- ignore: true,
- perms: { net: true },
- },
- async function netDoubleCloseWrite() {
- const addr = { hostname: "127.0.0.1", port: 3500 };
- const listener = Deno.listen(addr);
- const closeDeferred = deferred();
- listener.accept().then(async (conn) => {
- await closeDeferred;
- conn.close();
});
- const conn = await Deno.connect(addr);
- conn.closeWrite(); // closing write
- assertThrows(() => {
- // Duplicated close should throw error
- conn.closeWrite();
- }, Deno.errors.NotConnected);
closeDeferred.resolve();
listener.close();
conn.close();