summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-01-25 02:36:13 +1100
committerGitHub <noreply@github.com>2024-01-24 16:36:13 +0100
commita5a973e93c19b95b604adf9862dfafaf4becee04 (patch)
tree3dd388cf3d93cb1a60d40742f035bdfd2aafc5df /cli/tests
parent50eaeabefb83042686e271687979c2a0c40cc7e6 (diff)
feat: deprecate `Deno.write()` and `Deno.writeSync()` (#22064)
For removal in Deno v2.
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit/sync_test.ts2
-rw-r--r--cli/tests/unit_node/_fs/_fs_fdatasync_test.ts2
-rw-r--r--cli/tests/unit_node/tls_test.ts4
3 files changed, 4 insertions, 4 deletions
diff --git a/cli/tests/unit/sync_test.ts b/cli/tests/unit/sync_test.ts
index c6da9f23f..40a8054c0 100644
--- a/cli/tests/unit/sync_test.ts
+++ b/cli/tests/unit/sync_test.ts
@@ -27,7 +27,7 @@ Deno.test(
create: true,
});
const data = new Uint8Array(64);
- await Deno.write(file.rid, data);
+ await file.write(data);
await Deno.fdatasync(file.rid);
assertEquals(await Deno.readFile(filename), data);
await Deno.remove(filename);
diff --git a/cli/tests/unit_node/_fs/_fs_fdatasync_test.ts b/cli/tests/unit_node/_fs/_fs_fdatasync_test.ts
index 6a58eba12..5a57ba553 100644
--- a/cli/tests/unit_node/_fs/_fs_fdatasync_test.ts
+++ b/cli/tests/unit_node/_fs/_fs_fdatasync_test.ts
@@ -13,7 +13,7 @@ Deno.test({
create: true,
});
const data = new Uint8Array(64);
- await Deno.write(file.rid, data);
+ await file.write(data);
await new Promise<void>((resolve, reject) => {
fdatasync(file.rid, (err: Error | null) => {
diff --git a/cli/tests/unit_node/tls_test.ts b/cli/tests/unit_node/tls_test.ts
index e7224ff6d..3e6a892bd 100644
--- a/cli/tests/unit_node/tls_test.ts
+++ b/cli/tests/unit_node/tls_test.ts
@@ -117,13 +117,13 @@ Deno.test("tls.createServer creates a TLS server", async () => {
assertEquals(text.replaceAll("\0", ""), "welcome!\n");
buf.fill(0);
- Deno.write(conn.rid, new TextEncoder().encode("hey\n"));
+ await conn.write(new TextEncoder().encode("hey\n"));
await conn.read(buf);
text = new TextDecoder().decode(buf);
assertEquals(text.replaceAll("\0", ""), "hey\n");
buf.fill(0);
- Deno.write(conn.rid, new TextEncoder().encode("goodbye\n"));
+ await conn.write(new TextEncoder().encode("goodbye\n"));
await conn.read(buf);
text = new TextDecoder().decode(buf);
assertEquals(text.replaceAll("\0", ""), "goodbye\n");