diff options
author | J2P <jjp5023@gmail.com> | 2018-09-25 23:40:37 +0900 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-09-25 12:47:13 -0400 |
commit | 3c24b9f724287d2ca722e61a395ad9c93b7551c6 (patch) | |
tree | bdb6190bca4129873367f5aae2a4d218c7610e1f /js | |
parent | f156a86024fc98e63f42c1c7acccac0af10950ef (diff) |
Fix trace test code
Diffstat (limited to 'js')
-rw-r--r-- | js/trace_test.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/js/trace_test.ts b/js/trace_test.ts index ac83c1064..f0c0afc13 100644 --- a/js/trace_test.ts +++ b/js/trace_test.ts @@ -8,7 +8,7 @@ testPerm({ write: true }, async function traceFunctionSuccess() { // Mixing sync and async calls const filename = deno.makeTempDirSync() + "/test.txt"; await deno.writeFile(filename, data, 0o666); - await deno.removeSync(filename); + deno.removeSync(filename); }); assertEqual(op.length, 3); assertEqual(op[0], { sync: true, name: "MakeTempDir" }); @@ -25,7 +25,7 @@ testPerm({ write: true }, async function tracePromiseSuccess() { // Mixing sync and async calls const filename = deno.makeTempDirSync() + "/test.txt"; await deno.writeFile(filename, data, 0o666); - await deno.removeSync(filename); + deno.removeSync(filename); }; const promise = Promise.resolve().then(asyncFunction); const op = await deno.trace(promise); @@ -39,7 +39,7 @@ testPerm({ write: true }, async function traceRepeatSuccess() { const op1 = await deno.trace(async () => await deno.makeTempDir()); assertEqual(op1.length, 1); assertEqual(op1[0], { sync: false, name: "MakeTempDir" }); - const op2 = await deno.trace(async () => await deno.statSync(".")); + const op2 = await deno.trace(() => deno.statSync(".")); assertEqual(op2.length, 1); assertEqual(op2[0], { sync: true, name: "Stat" }); }); @@ -75,7 +75,7 @@ testPerm({ write: true }, async function traceIdempotence() { assertEqual(op3[0], { sync: false, name: "Remove" }); // Expect top-level repeat still works after all the nestings - const op4 = await deno.trace(async () => await deno.statSync(".")); + const op4 = await deno.trace(() => deno.statSync(".")); assertEqual(op4.length, 1); assertEqual(op4[0], { sync: true, name: "Stat" }); }); |