mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Add a very simple integration test for bun create next & bun create react
This commit is contained in:
16
Makefile
16
Makefile
@@ -501,13 +501,25 @@ mkdir-dev:
|
||||
test-install:
|
||||
cd integration/scripts && pnpm install
|
||||
|
||||
test-all: test-install test-with-hmr test-no-hmr
|
||||
test-all: test-install test-with-hmr test-no-hmr test-dev-create-next test-dev-create-react
|
||||
|
||||
copy-test-node-modules:
|
||||
rm -rf integration/snippets/package-json-exports/node_modules || echo "";
|
||||
cp -r integration/snippets/package-json-exports/_node_modules_copy integration/snippets/package-json-exports/node_modules || echo "";
|
||||
kill-bun:
|
||||
-killall -9 bun bun-debug
|
||||
|
||||
test-dev-create-next:
|
||||
BUN_BIN=$(DEBUG_BUN) bash integration/apps/bun-create-next.sh
|
||||
|
||||
test-dev-create-react:
|
||||
BUN_BIN=$(DEBUG_BUN) bash integration/apps/bun-create-react.sh
|
||||
|
||||
test-create-next:
|
||||
BUN_BIN=$(RELEASE_BUN) bash integration/apps/bun-create-next.sh
|
||||
|
||||
test-create-react:
|
||||
BUN_BIN=$(RELEASE_BUN) bash integration/apps/bun-create-react.sh
|
||||
|
||||
test-with-hmr: kill-bun copy-test-node-modules
|
||||
BUN_BIN=$(RELEASE_BUN) node integration/scripts/browser.js
|
||||
@@ -524,7 +536,7 @@ 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-all: test-dev-with-hmr test-dev-no-hmr test-dev-create-next text-dev-create-react
|
||||
|
||||
test-dev: test-dev-with-hmr
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@bun-examples/next",
|
||||
"version": "0.0.35",
|
||||
"version": "0.0.37",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"next": "11.1.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@bun-examples/react",
|
||||
"version": "0.0.31",
|
||||
"version": "0.0.32",
|
||||
"dependencies": {
|
||||
"@testing-library/jest-dom": "^5.11.4",
|
||||
"@testing-library/react": "^11.1.0",
|
||||
|
||||
14
integration/apps/bun-create-next.sh
Normal file
14
integration/apps/bun-create-next.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
killall -9 $(basename $BUN_BIN) || echo "";
|
||||
|
||||
rm -rf /tmp/next-app;
|
||||
mkdir -p /tmp/next-app;
|
||||
$BUN_BIN create next /tmp/next-app;
|
||||
cd /tmp/next-app;
|
||||
$BUN_BIN --port 8087 &
|
||||
sleep 0.005
|
||||
|
||||
curl --fail http://localhost:8087/ && killall -9 $(basename $BUN_BIN) && echo "✅ bun create next passed."
|
||||
exit $?
|
||||
|
||||
14
integration/apps/bun-create-react.sh
Normal file
14
integration/apps/bun-create-react.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
killall -9 $(basename $BUN_BIN) || echo "";
|
||||
|
||||
rm -rf /tmp/react-app;
|
||||
mkdir -p /tmp/react-app;
|
||||
$BUN_BIN create react /tmp/react-app;
|
||||
cd /tmp/react-app;
|
||||
$BUN_BIN --port 8087 &
|
||||
sleep 0.005
|
||||
|
||||
curl --fail http://localhost:8087/ && killall -9 $(basename $BUN_BIN) && echo "✅ bun create react passed."
|
||||
exit $?
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"directories": {
|
||||
"bin": "bin"
|
||||
},
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"directories": {
|
||||
"bin": "bin"
|
||||
},
|
||||
"name": "bun-cli-darwin-x64",
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"repository": "https://github.com/jarred-sumner/bun",
|
||||
"version": "0.0.36"
|
||||
"version": "0.0.37"
|
||||
}
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
scripts
|
||||
reset-bin.js
|
||||
pnpm-lock.yaml
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
"bun": "bin/bun"
|
||||
},
|
||||
"description": "Bun: a fast bundler, transpiler and task runner for web software. To get early access, join the Discord https://bun.sh/discord",
|
||||
"homepage": "https://bun.sh",
|
||||
"license": "MIT",
|
||||
"name": "bun-cli",
|
||||
"homepage": "https://bun.sh",
|
||||
"optionalDependencies": {
|
||||
"bun-cli-darwin-aarch64": "0.0.37",
|
||||
"bun-cli-darwin-x64": "0.0.37",
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
*.bun
|
||||
node_modules
|
||||
node_modules
|
||||
pnpm-log.yaml
|
||||
yarn-error.log
|
||||
yarn.lock
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "bun-framework-next",
|
||||
"version": "0.0.0-22",
|
||||
"description": "",
|
||||
"version": "0.0.0-23",
|
||||
"description": "Bun compatibility layer for Next.js v11.1.2",
|
||||
"framework": {
|
||||
"displayName": "Next.js",
|
||||
"static": "public",
|
||||
|
||||
Reference in New Issue
Block a user