summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit/command_test.ts3
-rw-r--r--cli/tests/unit/process_test.ts3
-rw-r--r--cli/tests/unit_node/_fs/_fs_ftruncate_test.ts4
-rw-r--r--cli/tests/unit_node/_fs/_fs_truncate_test.ts4
4 files changed, 6 insertions, 8 deletions
diff --git a/cli/tests/unit/command_test.ts b/cli/tests/unit/command_test.ts
index 1c707651c..cbb1c4921 100644
--- a/cli/tests/unit/command_test.ts
+++ b/cli/tests/unit/command_test.ts
@@ -208,8 +208,7 @@ Deno.test(
async function commandRedirectStdin() {
const tempDir = await Deno.makeTempDir();
const fileName = tempDir + "/redirected_stdio.txt";
- const encoder = new TextEncoder();
- await Deno.writeFile(fileName, encoder.encode("hello"));
+ await Deno.writeTextFile(fileName, "hello");
const file = await Deno.open(fileName);
const command = new Deno.Command(Deno.execPath(), {
diff --git a/cli/tests/unit/process_test.ts b/cli/tests/unit/process_test.ts
index f6ad2a5cd..cb5dd0815 100644
--- a/cli/tests/unit/process_test.ts
+++ b/cli/tests/unit/process_test.ts
@@ -395,8 +395,7 @@ Deno.test(
async function runRedirectStdin() {
const tempDir = await Deno.makeTempDir();
const fileName = tempDir + "/redirected_stdio.txt";
- const encoder = new TextEncoder();
- await Deno.writeFile(fileName, encoder.encode("hello"));
+ await Deno.writeTextFile(fileName, "hello");
const file = await Deno.open(fileName);
// deno-lint-ignore no-deprecated-deno-api
diff --git a/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts b/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts
index a843b19b7..4c2c34789 100644
--- a/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts
+++ b/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts
@@ -24,7 +24,7 @@ Deno.test({
name: "ASYNC: truncate entire file contents",
async fn() {
const file: string = Deno.makeTempFileSync();
- await Deno.writeFile(file, new TextEncoder().encode("hello world"));
+ await Deno.writeTextFile(file, "hello world");
const { rid } = await Deno.open(file, {
read: true,
write: true,
@@ -57,7 +57,7 @@ Deno.test({
name: "ASYNC: truncate file to a size of precisely len bytes",
async fn() {
const file: string = Deno.makeTempFileSync();
- await Deno.writeFile(file, new TextEncoder().encode("hello world"));
+ await Deno.writeTextFile(file, "hello world");
const { rid } = await Deno.open(file, {
read: true,
write: true,
diff --git a/cli/tests/unit_node/_fs/_fs_truncate_test.ts b/cli/tests/unit_node/_fs/_fs_truncate_test.ts
index 00e03ab0e..ff087095b 100644
--- a/cli/tests/unit_node/_fs/_fs_truncate_test.ts
+++ b/cli/tests/unit_node/_fs/_fs_truncate_test.ts
@@ -24,7 +24,7 @@ Deno.test({
name: "ASYNC: truncate entire file contents",
async fn() {
const file: string = Deno.makeTempFileSync();
- await Deno.writeFile(file, new TextEncoder().encode("hello world"));
+ await Deno.writeTextFile(file, "hello world");
await new Promise<void>((resolve, reject) => {
truncate(file, (err: Error | null) => {
@@ -49,7 +49,7 @@ Deno.test({
name: "ASYNC: truncate file to a size of precisely len bytes",
async fn() {
const file: string = Deno.makeTempFileSync();
- await Deno.writeFile(file, new TextEncoder().encode("hello world"));
+ await Deno.writeTextFile(file, "hello world");
await new Promise<void>((resolve, reject) => {
truncate(file, 3, (err: Error | null) => {