diff options
author | Adam Odziemkowski <odziem@users.noreply.github.com> | 2020-05-29 02:43:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-29 02:43:31 -0400 |
commit | 958f21e7abc36f0a5abaa381ed8d7f94c723f3fb (patch) | |
tree | 0e6d2c8664b0c8a7477fa0c37b7b1fac760ff2fa /cli/tests | |
parent | 499353ff399ccb6f1c27694ecc861e34a572cada (diff) |
fix(cli): write lock file before running any code (#5794)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/file_exists.ts | 6 | ||||
-rw-r--r-- | cli/tests/lock_write_fetch.ts | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/cli/tests/file_exists.ts b/cli/tests/file_exists.ts new file mode 100644 index 000000000..5fc5414b3 --- /dev/null +++ b/cli/tests/file_exists.ts @@ -0,0 +1,6 @@ +try { + await Deno.open(Deno.args[0]); + Deno.exit(0); +} catch (e) { + Deno.exit(1); +} diff --git a/cli/tests/lock_write_fetch.ts b/cli/tests/lock_write_fetch.ts index 9e7190596..5a4dea0ce 100644 --- a/cli/tests/lock_write_fetch.ts +++ b/cli/tests/lock_write_fetch.ts @@ -32,6 +32,8 @@ const fetchCheckProc = Deno.run({ const fetchCheckProcCode = (await fetchCheckProc.status()).code; console.log(`fetch check code: ${fetchCheckProcCode}`); +Deno.removeSync("./lock_write_fetch.json"); + const runProc = Deno.run({ stdout: "null", stderr: "null", @@ -39,7 +41,10 @@ const runProc = Deno.run({ Deno.execPath(), "run", "--lock=lock_write_fetch.json", - "https_import.ts", + "--lock-write", + "--allow-read", + "file_exists.ts", + "lock_write_fetch.json", ], }); |