1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
This commit is contained in:
Rares Folea 2020-05-25 16:35:11 +03:00 committed by GitHub
parent 1c4a9665e2
commit aef9f22462
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,13 +10,13 @@ const destFile = "./destination.txt";
test({
name: "[std/node/fs] copy file",
fn: async () => {
const srouceFile = Deno.makeTempFileSync();
const sourceFile = Deno.makeTempFileSync();
const err = await new Promise((resolve) => {
copyFile(srouceFile, destFile, (err?: Error | null) => resolve(err));
copyFile(sourceFile, destFile, (err?: Error | null) => resolve(err));
});
assert(!err);
assert(existsSync(destFile));
Deno.removeSync(srouceFile);
Deno.removeSync(sourceFile);
Deno.removeSync(destFile);
},
});
@ -24,10 +24,10 @@ test({
test({
name: "[std/node/fs] copy file sync",
fn: () => {
const srouceFile = Deno.makeTempFileSync();
copyFileSync(srouceFile, destFile);
const sourceFile = Deno.makeTempFileSync();
copyFileSync(sourceFile, destFile);
assert(existsSync(destFile));
Deno.removeSync(srouceFile);
Deno.removeSync(sourceFile);
Deno.removeSync(destFile);
},
});