1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-04 17:18:23 -05:00
denoland-deno/std/io/util_test.ts

19 lines
539 B
TypeScript
Raw Normal View History

2020-01-02 15:13:47 -05:00
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { assert } from "../testing/asserts.ts";
import * as path from "../path/mod.ts";
import { tempFile } from "./util.ts";
Deno.test({
name: "[io/util] tempfile",
fn: async function (): Promise<void> {
const f = await tempFile(".", {
prefix: "prefix-",
postfix: "-postfix",
});
const base = path.basename(f.filepath);
assert(!!base.match(/^prefix-.+?-postfix$/));
f.file.close();
await Deno.remove(f.filepath);
},
});