aboutsummaryrefslogtreecommitdiff
path: root/test/apps/bun-create-react.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/apps/bun-create-react.sh')
-rw-r--r--test/apps/bun-create-react.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/apps/bun-create-react.sh b/test/apps/bun-create-react.sh
index 41552dee5..e903b3f65 100644
--- a/test/apps/bun-create-react.sh
+++ b/test/apps/bun-create-react.sh
@@ -1,19 +1,20 @@
#!/bin/bash
-killall -9 $(basename $BUN_BIN) || echo ""
+set -euo pipefail
-rm -rf /tmp/react-app
-mkdir -p /tmp/react-app
-$BUN_BIN create react /tmp/react-app
+killall -9 "$(basename "$BUN_BIN")" || echo ""
+
+DIR=$(mktemp -d -t react-app)
+$BUN_BIN create react "$DIR"
if (($?)); then
echo "bun create failed"
exit 1
fi
-cd /tmp/react-app
+cd "$DIR"
BUN_CRASH_WITHOUT_JIT=1 $BUN_BIN dev --port 8087 &
sleep 0.005
-curl --fail http://localhost:8087/ && curl --fail http://localhost:8087/src/index.jsx && killall -9 $(basename $BUN_BIN) && echo "✅ bun create react passed."
+curl --fail http://localhost:8087/ && curl --fail http://localhost:8087/src/index.jsx && killall -9 "$(basename "$BUN_BIN")" && echo "✅ bun create react passed."
exit $?