diff options
Diffstat (limited to 'cli/tests/testdata/lock_write_fetch.ts')
| -rw-r--r-- | cli/tests/testdata/lock_write_fetch.ts | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/cli/tests/testdata/lock_write_fetch.ts b/cli/tests/testdata/lock_write_fetch.ts new file mode 100644 index 000000000..b6ecf4747 --- /dev/null +++ b/cli/tests/testdata/lock_write_fetch.ts @@ -0,0 +1,58 @@ +try { + Deno.removeSync("./lock_write_fetch.json"); +} catch { + // pass +} + +const fetchProc = Deno.run({ + stdout: "null", + stderr: "null", + cmd: [ + Deno.execPath(), + "cache", + "--reload", + "--lock=lock_write_fetch.json", + "--lock-write", + "--cert=tls/RootCA.pem", + "https_import.ts", + ], +}); + +const fetchCode = (await fetchProc.status()).code; +console.log(`fetch code: ${fetchCode}`); + +const fetchCheckProc = Deno.run({ + stdout: "null", + stderr: "null", + cmd: [ + Deno.execPath(), + "cache", + "--lock=lock_write_fetch.json", + "--cert=tls/RootCA.pem", + "https_import.ts", + ], +}); + +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", + cmd: [ + Deno.execPath(), + "run", + "--lock=lock_write_fetch.json", + "--lock-write", + "--allow-read", + "file_exists.ts", + "lock_write_fetch.json", + ], +}); + +const runCode = (await runProc.status()).code; +console.log(`run code: ${runCode}`); + +Deno.removeSync("./lock_write_fetch.json"); |
