diff options
Diffstat (limited to 'tests/specs/npm/lifecycle_scripts/__test__.jsonc')
-rw-r--r-- | tests/specs/npm/lifecycle_scripts/__test__.jsonc | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/tests/specs/npm/lifecycle_scripts/__test__.jsonc b/tests/specs/npm/lifecycle_scripts/__test__.jsonc index b798b968f..589c131dd 100644 --- a/tests/specs/npm/lifecycle_scripts/__test__.jsonc +++ b/tests/specs/npm/lifecycle_scripts/__test__.jsonc @@ -5,7 +5,7 @@ "steps": [ { "args": "cache --allow-scripts=npm:@denotest/node-addon main.js", - "output": "[WILDCARD]gyp info ok \n" + "output": "[WILDCARD]Initialize @denotest/node-addon@1.0.0: running 'install' script\n" }, { "args": "run -A main.js", @@ -38,7 +38,7 @@ "steps": [ { // without running scripts (should warn) - "args": "cache all_lifecycles.js", + "args": "run all_lifecycles.js", "output": "all_lifecycles_not_run.out" }, { @@ -51,6 +51,23 @@ } ] }, + "deno_run_lifecycle_scripts": { + "steps": [ + { + // without running scripts (should warn) + "args": "run all_lifecycles.js", + "output": "all_lifecycles_not_run.out" + }, + { + // now run scripts + "args": "run --allow-scripts all_lifecycles.js", + // this test package covers running preinstall, install, and postinstall scripts + // it also exercises running bin packages (esbuild in this case), using `node` in a script + // (with and without node-only CLI flags), and using `npx` in a script + "output": "all_lifecycles_deno_run.out" + } + ] + }, "global_lifecycle_scripts": { "steps": [ { @@ -79,14 +96,12 @@ { // without running scripts (should warn) "args": "run all_lifecycles.js", - "output": "only_warns_first1.out", - "exitCode": 1 + "output": "only_warns_first1.out" }, { // without running scripts (does not warn) "args": "run all_lifecycles.js", - "output": "only_warns_first2.out", - "exitCode": 1 + "output": "only_warns_first2.out" }, { // should warn because this is an explicit install @@ -128,6 +143,13 @@ // we run the install script, we should use the correct binary (relative to the package) "args": "cache --allow-scripts conflicting_bin.js", "output": "conflicting_bin.out" + }, + { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('./say-hello-output.txt'))" + ], + "output": "conflicting_bin2.out" } ] }, |