diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-08-14 21:50:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-14 22:50:06 +0200 |
commit | 22a834ff5b4b312b8f91be8991f2b495d49fad2f (patch) | |
tree | 66ed83a0898396a950c040aa70192bda95f9102e /tests/unit/net_test.ts | |
parent | f89b5311492377a3ac18d756dc8c8a309e2c9e8a (diff) |
test: run unit tests with DENO_FUTURE=1 (#24400)
This commit adds another test suite that runs all Deno unit tests
with `DENO_FUTURE=1` flag to ensure all APIs are working as
expected, once Deno 2 is released.
---------
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'tests/unit/net_test.ts')
-rw-r--r-- | tests/unit/net_test.ts | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/tests/unit/net_test.ts b/tests/unit/net_test.ts index ddc55b8c4..9cd3094e5 100644 --- a/tests/unit/net_test.ts +++ b/tests/unit/net_test.ts @@ -6,6 +6,7 @@ import { assertRejects, assertThrows, delay, + DENO_FUTURE, execCode, execCode2, tmpUnixSocketPath, @@ -27,7 +28,9 @@ Deno.test({ permissions: { net: true } }, function netTcpListenClose() { assert(listener.addr.transport === "tcp"); assertEquals(listener.addr.hostname, "127.0.0.1"); assertEquals(listener.addr.port, listenPort); - assertNotEquals(listener.rid, 0); + if (!DENO_FUTURE) { + assertNotEquals(listener.rid, 0); + } listener.close(); }); @@ -233,7 +236,9 @@ Deno.test({ permissions: { net: true } }, async function netTcpDialListen() { assertEquals(1, buf[0]); assertEquals(2, buf[1]); assertEquals(3, buf[2]); - assert(conn.rid > 0); + if (!DENO_FUTURE) { + assert(conn.rid > 0); + } assert(readResult !== null); @@ -269,7 +274,9 @@ Deno.test({ permissions: { net: true } }, async function netTcpSetNoDelay() { assertEquals(1, buf[0]); assertEquals(2, buf[1]); assertEquals(3, buf[2]); - assert(conn.rid > 0); + if (!DENO_FUTURE) { + assert(conn.rid > 0); + } assert(readResult !== null); @@ -305,7 +312,9 @@ Deno.test({ permissions: { net: true } }, async function netTcpSetKeepAlive() { assertEquals(1, buf[0]); assertEquals(2, buf[1]); assertEquals(3, buf[2]); - assert(conn.rid > 0); + if (!DENO_FUTURE) { + assert(conn.rid > 0); + } assert(readResult !== null); @@ -343,7 +352,9 @@ Deno.test( assertEquals(1, buf[0]); assertEquals(2, buf[1]); assertEquals(3, buf[2]); - assert(conn.rid > 0); + if (!DENO_FUTURE) { + assert(conn.rid > 0); + } assert(readResult !== null); @@ -839,7 +850,9 @@ Deno.test( assertEquals(1, buf[0]); assertEquals(2, buf[1]); assertEquals(3, buf[2]); - assert(conn.rid > 0); + if (!DENO_FUTURE) { + assert(conn.rid > 0); + } assert(readResult !== null); |