diff options
Diffstat (limited to 'test/apps/bun-create-next.sh')
-rw-r--r-- | test/apps/bun-create-next.sh | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/test/apps/bun-create-next.sh b/test/apps/bun-create-next.sh index 4f19e535d..110351d97 100644 --- a/test/apps/bun-create-next.sh +++ b/test/apps/bun-create-next.sh @@ -4,21 +4,20 @@ set -euo pipefail # The important part of this test: make sure that bun.js successfully loads # The most likely reason for this test to fail is that something broke in the JavaScriptCore <> bun integration -killall -9 $(basename $BUN_BIN) || echo "" +killall -9 "$(basename "$BUN_BIN")" || echo "" -rm -rf /tmp/next-app -mkdir -p /tmp/next-app -$BUN_BIN create next /tmp/next-app +DIR=$(mktemp -d -t next-app) +$BUN_BIN create next "$DIR" if (($?)); then echo "bun create failed" exit 1 fi -echo "hi!" >/tmp/next-app/public/file.txt -echo "export default 'string';" >/tmp/next-app/file.js +echo "hi!" >"$DIR/public/file.txt" +echo "export default 'string';" >"$DIR/file.js" -cd /tmp/next-app +cd "$DIR" BUN_CRASH_WITHOUT_JIT=1 $BUN_BIN dev --port 8087 & sleep 0.1 curl --fail -Ss http://localhost:8087/ @@ -28,7 +27,7 @@ if [[ "$(curl --fail -sS http://localhost:8087/file.txt)" != "hi!" ]]; then echo "" echo "" echo "ERR: Expected 'hi!', got '$(curl --fail -sS http://localhost:8087/file.txt)'" - killall -9 $(basename $BUN_BIN) || echo "" + killall -9 "$(basename "$BUN_BIN")" || echo "" exit 1 fi @@ -37,12 +36,12 @@ if [[ "$(curl --fail -sS http://localhost:8087/file.js)" != *"string"* ]]; then echo "" echo "" echo "ERR: Expected file to contain string got '$(curl --fail -sS http://localhost:8087/file.js)'" - killall -9 $(basename $BUN_BIN) || echo "" + killall -9 "$(basename "$BUN_BIN")" || echo "" exit 1 fi # very simple HMR test -echo "export default 'string';" >/tmp/next-app/file2.js +echo "export default 'string';" >"$DIR/file2.js" sleep 0.1 if [[ "$(curl --fail -sS http://localhost:8087/file2.js)" != *"string"* ]]; then @@ -50,8 +49,8 @@ if [[ "$(curl --fail -sS http://localhost:8087/file2.js)" != *"string"* ]]; then echo "" echo "" echo "ERR: Expected file to contain string got '$(curl --fail -sS http://localhost:8087/file2.js)'" - killall -9 $(basename $BUN_BIN) || echo "" + killall -9 "$(basename "$BUN_BIN")" || echo "" exit 1 fi -killall -9 $(basename $BUN_BIN) || echo "" +killall -9 "$(basename "$BUN_BIN")" || echo "" |