summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2020-10-19 00:16:26 +0800
committerGitHub <noreply@github.com>2020-10-18 12:16:26 -0400
commit065db9df19fa9f1f598fc3a5c7fd978b484428de (patch)
tree83080b4024807916971588c62f232ba796f822fe
parent3e51610bbb5d5d63863b9989690ca1e8127fdf88 (diff)
test(std/io): use a real tempdir (#8019)
This replaces a case of a temp file in the working tree with a tempfile in a real temporary directory avoiding pollution of the working directory.
-rw-r--r--std/io/ioutil_test.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/std/io/ioutil_test.ts b/std/io/ioutil_test.ts
index 69f76f691..9b17ce66d 100644
--- a/std/io/ioutil_test.ts
+++ b/std/io/ioutil_test.ts
@@ -9,8 +9,6 @@ import {
} from "./ioutil.ts";
import { StringReader } from "./readers.ts";
import { BufReader } from "./bufio.ts";
-import { tempFile } from "./util.ts";
-import * as path from "../path/mod.ts";
class BinaryReader implements Deno.Reader {
index = 0;
@@ -87,7 +85,10 @@ Deno.test("testCopyN2", async function (): Promise<void> {
});
Deno.test("copyNWriteAllData", async function (): Promise<void> {
- const { filepath, file } = await tempFile(path.resolve("io"));
+ const tmpDir = await Deno.makeTempDir();
+ const filepath = `${tmpDir}/data`;
+ const file = await Deno.open(filepath, { create: true, write: true });
+
const size = 16 * 1024 + 1;
const data = "a".repeat(32 * 1024);
const r = new StringReader(data);