fix(cli): cover every npm install lifecycle hook

npm runs prepublish, preprepare and postprepare on install too, so a project
using one of those would have had its install layer split and the hook would
run against a source tree that is not there yet.
This commit is contained in:
Elior Nataf Lackritz
2026-08-12 16:03:24 -04:00
parent 77fbf25d41
commit 750f31482e
2 changed files with 20 additions and 3 deletions
+10 -1
View File
@@ -3531,7 +3531,16 @@ class TestNodeDependencyLayerOrdering:
)
@pytest.mark.parametrize(
"hook", ["preinstall", "install", "postinstall", "prepare"]
"hook",
[
"preinstall",
"install",
"postinstall",
"prepublish",
"preprepare",
"prepare",
"postprepare",
],
)
def test_install_hook_keeps_source_first(
self, tmp_path: pathlib.Path, hook: str