Skip to content

Commit

Permalink
adjust tests and message
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Sep 18, 2024
1 parent 98bb5aa commit cc1c075
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 20 deletions.
4 changes: 1 addition & 3 deletions cli/npm/managed/resolvers/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,7 @@ async fn sync_resolution_with_fs(
"┠─ {}",
colors::italic("This may cause the packages to not work correctly.")
);
log::warn!("┠─ {}", colors::italic("To run lifecycle scripts, use the `--allow-scripts` flag with `deno install`"));
log::warn!("┃");
log::warn!("┗─ If you want to run lifecycle script, run:");
log::warn!("┗─ {}", colors::italic("To run lifecycle scripts, use the `--allow-scripts` flag with `deno install`:"));
let packages_comma_separated = packages_with_scripts_not_run
.iter()
.map(|(_, p)| format!("npm:{p}"))
Expand Down
3 changes: 2 additions & 1 deletion tests/specs/install/install_deprecated_package/install.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Add npm:@denotest/deprecated-package@1.0.0
Download http://localhost:4260/@denotest/deprecated-package
Download http://localhost:4260/@denotest/deprecated-package/1.0.0.tgz
Initialize @denotest/deprecated-package@1.0.0
Warning @denotest/deprecated-package@1.0.0 is deprecated: Deprecated version
Warning Following packages are deprecated:
┗─ npm:@denotest/deprecated-package@1.0.0 (Deprecated version)
10 changes: 6 additions & 4 deletions tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Download http://localhost:4260/@denotest/bin/1.0.0.tgz
Initialize @denotest/node-lifecycle-scripts@1.0.0
Initialize @denotest/bin@1.0.0
[UNORDERED_END]
Warning Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
This may cause the packages to not work correctly. To run them, use the `--allow-scripts` flag with `deno cache` or `deno install`
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>` or `deno install --allow-scripts=pkg1,pkg2`):
npm:@denotest/node-lifecycle-scripts@1.0.0
Warning Following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed:
┠─ npm:@denotest/node-lifecycle-scripts@1.0.0
┠─ This may cause the packages to not work correctly.
┗─ To run lifecycle scripts, use the `--allow-scripts` flag with `deno install`:
deno install --allow-scripts=npm:@denotest/node-lifecycle-scripts@1.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Download http://localhost:4260/@denotest/bin/1.0.0.tgz
Initialize @denotest/node-lifecycle-scripts@1.0.0
Initialize @denotest/bin@1.0.0
[UNORDERED_END]
Warning Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
This may cause the packages to not work correctly. To run them, use the `--allow-scripts` flag with `deno cache` or `deno install`
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>` or `deno install --allow-scripts=pkg1,pkg2`):
npm:@denotest/node-lifecycle-scripts@1.0.0
Warning Following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed:
┠─ npm:@denotest/node-lifecycle-scripts@1.0.0
┠─ This may cause the packages to not work correctly.
┗─ To run lifecycle scripts, use the `--allow-scripts` flag with `deno install`:
deno install --allow-scripts=npm:@denotest/node-lifecycle-scripts@1.0.0
10 changes: 6 additions & 4 deletions tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Download http://localhost:4260/@denotest/node-addon
Download http://localhost:4260/node-gyp
[WILDCARD]
Warning Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
This may cause the packages to not work correctly. To run them, use the `--allow-scripts` flag with `deno cache` or `deno install`
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>` or `deno install --allow-scripts=pkg1,pkg2`):
npm:@denotest/node-addon@1.0.0
Warning Following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed:
┠─ npm:@denotest/node-addon@1.0.0
┠─ This may cause the packages to not work correctly.
┗─ To run lifecycle scripts, use the `--allow-scripts` flag with `deno install`:
deno install --allow-scripts=npm:@denotest/node-addon@1.0.0
error: Uncaught (in promise) Error: Cannot find module './build/Release/node_addon'
[WILDCARD]
10 changes: 6 additions & 4 deletions tests/specs/npm/lifecycle_scripts/only_warns_first1.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ Download http://localhost:4260/@denotest/bin/1.0.0.tgz
Initialize @denotest/node-lifecycle-scripts@1.0.0
Initialize @denotest/bin@1.0.0
[UNORDERED_END]
Warning Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
This may cause the packages to not work correctly. To run them, use the `--allow-scripts` flag with `deno cache` or `deno install`
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>` or `deno install --allow-scripts=pkg1,pkg2`):
npm:@denotest/node-lifecycle-scripts@1.0.0
Warning Following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed:
┠─ npm:@denotest/node-lifecycle-scripts@1.0.0
┠─ This may cause the packages to not work correctly.
┗─ To run lifecycle scripts, use the `--allow-scripts` flag with `deno install`:
deno install --allow-scripts=npm:@denotest/node-lifecycle-scripts@1.0.0
error: Uncaught SyntaxError: The requested module 'npm:@denotest/node-lifecycle-scripts' does not provide an export named 'value'
[WILDCARD]

0 comments on commit cc1c075

Please sign in to comment.