diff options
| author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-01-22 07:58:24 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-21 21:58:24 +0100 |
| commit | e58462dbb9b8b611628c5d8da7e523e48a58242c (patch) | |
| tree | 61441d62da93b46565cfeeedfe22d977432daf4c /cli/tests/unit | |
| parent | 1b9f0cb452e672c187233de23cd74c7f8a3f773b (diff) | |
chore: use `Deno.writeTextFile()` where appropriate (#22008)
Diffstat (limited to 'cli/tests/unit')
| -rw-r--r-- | cli/tests/unit/command_test.ts | 3 | ||||
| -rw-r--r-- | cli/tests/unit/process_test.ts | 3 |
2 files changed, 2 insertions, 4 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 |
