aboutsummaryrefslogtreecommitdiff
path: root/integration
diff options
context:
space:
mode:
Diffstat (limited to 'integration')
-rw-r--r--integration/apps/bun-install-lockfile-status.sh27
1 files changed, 19 insertions, 8 deletions
diff --git a/integration/apps/bun-install-lockfile-status.sh b/integration/apps/bun-install-lockfile-status.sh
index 72ba83878..c20bb32b2 100644
--- a/integration/apps/bun-install-lockfile-status.sh
+++ b/integration/apps/bun-install-lockfile-status.sh
@@ -16,7 +16,7 @@ git init && git add . && git commit -am "Initial commit"
$BUN_BIN install
-ORIG_LOCKFILE=$($BUN_BIN bun.lockb)
+ORIG_LOCKFILE="$($BUN_BIN pm hash-string)"
[[ -z $(git status --untracked-files=no --porcelain) ]] || {
echo "ERR: Expected empty git status, got '$(git status --untracked-files=no --porcelain)'"
@@ -25,7 +25,7 @@ ORIG_LOCKFILE=$($BUN_BIN bun.lockb)
$BUN_BIN add react
-NEW_LOCKFILE=$($BUN_BIN bun.lockb)
+NEW_LOCKFILE="$($BUN_BIN pm hash-string)"
diff <(echo "$ORIG_LOCKFILE") <(echo "$NEW_LOCKFILE") || {
echo "ERR: Expected lockfile to be unchanged, got '$NEW_LOCKFILE'"
@@ -37,15 +37,19 @@ diff <(echo "$ORIG_LOCKFILE") <(echo "$NEW_LOCKFILE") || {
exit 1
}
+ORIG_HASH=$($BUN_BIN bun.lockb --hash)
+
$BUN_BIN remove react
$BUN_BIN add react
-NEW_LOCKFILE=$($BUN_BIN bun.lockb)
+NEW_HASH=$($BUN_BIN bun.lockb --hash)
-diff <(echo "$ORIG_LOCKFILE") <(echo "$NEW_LOCKFILE") || {
- echo "ERR: Expected lockfile to be unchanged, got '$NEW_LOCKFILE'"
+if "$ORIG_HASH" != "$NEW_HASH"; then
+ echo "ERR: Expected hash to be unchanged, got '$NEW_HASH'"
exit 1
-}
+fi
+
+[
echo '{ "dependencies": { "react": "17.0.2", "react-dom": "17.0.2" } }' >package.json
@@ -57,5 +61,12 @@ $BUN_BIN run ./index.js
echo "var {version} = JSON.parse(require(\"fs\").readFileSync('./node_modules/react/package.json', 'utf8')); if (version !== '17.0.2') {throw new Error('Unexpected react version');}; " >index.js
$BUN_BIN run ./index.js
-realpath -e node_modules/react-dom
-realpath -e node_modules/react
+# This is just making sure that the JS was executed
+realpath -e node_modules/react-dom >/dev/null || {
+ echo "ERR: Expected react-dom to be installed"
+ exit 1
+}
+realpath -e node_modules/react >/dev/null || {
+ echo "ERR: Expected react to be installed"
+ exit 1
+}