aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-26 19:06:45 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-26 19:06:45 -0700
commitff1417421bf47051cbeeb1d82967347619748fd9 (patch)
treebe3010f9f6a29d32038d0f8e7e41828c89be67cc
parent00fb04f3099feb4d55298c42129e2d5bc9e31d80 (diff)
downloadbun-ff1417421bf47051cbeeb1d82967347619748fd9.tar.gz
bun-ff1417421bf47051cbeeb1d82967347619748fd9.tar.zst
bun-ff1417421bf47051cbeeb1d82967347619748fd9.zip
Simple integration test for `bun run`
-rw-r--r--Makefile12
-rw-r--r--integration/apps/bun-run-check-package.json6
-rw-r--r--integration/apps/bun-run-check.sh15
3 files changed, 29 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 35d70eb7d..c3df5acbd 100644
--- a/Makefile
+++ b/Makefile
@@ -501,7 +501,7 @@ mkdir-dev:
test-install:
cd integration/scripts && pnpm install
-test-all: test-install test-with-hmr test-no-hmr test-create-next test-create-react
+test-all: test-install test-with-hmr test-no-hmr test-create-next test-create-react test-bun-run
copy-test-node-modules:
rm -rf integration/snippets/package-json-exports/node_modules || echo "";
@@ -518,6 +518,9 @@ test-dev-create-react:
test-create-next:
BUN_BIN=$(RELEASE_BUN) bash integration/apps/bun-create-next.sh
+test-bun-run:
+ cd integration/apps && BUN_BIN=$(RELEASE_BUN) bash ./bun-run-check.sh
+
test-create-react:
BUN_BIN=$(RELEASE_BUN) bash integration/apps/bun-create-react.sh
@@ -536,7 +539,10 @@ test-dev-no-hmr: copy-test-node-modules
-killall bun-debug -9;
DISABLE_HMR="DISABLE_HMR" BUN_BIN=$(DEBUG_BUN) node integration/scripts/browser.js
-test-dev-all: test-dev-with-hmr test-dev-no-hmr test-dev-create-next text-dev-create-react
+test-dev-bun-run:
+ cd integration/apps && BUN_BIN=$(DEBUG_BUN) bash bun-run-check.sh
+
+test-dev-all: test-dev-with-hmr test-dev-no-hmr test-dev-create-next text-dev-create-react test-dev-bun-run
test-dev: test-dev-with-hmr
@@ -569,8 +575,6 @@ clean: clean-bindings
(cd src/deps/picohttp && make clean) || echo "";
(cd src/deps/zlib && make clean) || echo "";
-
-
jsc-bindings-mac: $(OBJ_FILES)
diff --git a/integration/apps/bun-run-check-package.json b/integration/apps/bun-run-check-package.json
new file mode 100644
index 000000000..6fabca272
--- /dev/null
+++ b/integration/apps/bun-run-check-package.json
@@ -0,0 +1,6 @@
+{
+ "name": "check",
+ "scripts": {
+ "this-should-work": "echo \"✅ bun run test passed!\""
+ }
+}
diff --git a/integration/apps/bun-run-check.sh b/integration/apps/bun-run-check.sh
new file mode 100644
index 000000000..72281c266
--- /dev/null
+++ b/integration/apps/bun-run-check.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+killall -9 $(basename $BUN_BIN) || echo "";
+
+rm -rf /tmp/bun-run-check
+mkdir -p /tmp/bun-run-check
+
+
+cp ./bun-run-check-package.json /tmp/bun-run-check/package.json
+cd /tmp/bun-run-check
+bun run --silent this-should-work
+exit $?
+
+
+