diff options
author | 2023-03-07 12:22:34 -0800 | |
---|---|---|
committer | 2023-03-07 12:22:34 -0800 | |
commit | f7e4eb83694aa007a492ef66c28ffbe6a2dae791 (patch) | |
tree | 7af25aa5c42a2e1b2b47ba1df35f8caa9054cbeb | |
parent | 36275a44ce7a33587bd26aad120042ab95470ff3 (diff) | |
download | bun-f7e4eb83694aa007a492ef66c28ffbe6a2dae791.tar.gz bun-f7e4eb83694aa007a492ef66c28ffbe6a2dae791.tar.zst bun-f7e4eb83694aa007a492ef66c28ffbe6a2dae791.zip |
Reorganize tests (#2332)
-rw-r--r-- | .github/workflows/bun-linux-build.yml | 4 | ||||
-rw-r--r-- | .github/workflows/bun-mac-x64-baseline.yml | 4 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | .prettierignore | 9 | ||||
-rw-r--r-- | Makefile | 113 | ||||
-rw-r--r-- | bunfig.toml | 4 | ||||
-rw-r--r-- | packages/bun-internal-test/package.json | 3 | ||||
-rw-r--r-- | packages/bun-internal-test/src/runner.node.mjs | 2 | ||||
-rw-r--r-- | packages/bun-internal-test/src/runner.ts | 94 | ||||
-rw-r--r-- | packages/bun-internal-test/tsconfig.json | 1 | ||||
-rw-r--r-- | test/.prettierignore (renamed from test/fixtures/bun-link-pkg-fixture/.gitignore) | 1 | ||||
-rw-r--r-- | test/README.md | 166 | ||||
-rw-r--r-- | test/apps/bun-create-next.sh | 57 | ||||
-rw-r--r-- | test/apps/bun-create-react.sh | 20 | ||||
-rw-r--r-- | test/apps/bun-dev-index-html.sh | 69 | ||||
-rw-r--r-- | test/apps/bun-dev.sh | 55 | ||||
-rw-r--r-- | test/apps/bun-init-check.sh | 26 | ||||
-rw-r--r-- | test/apps/bun-install-lockfile-status.sh | 65 | ||||
-rw-r--r-- | test/apps/bun-install-utf8.sh | 14 | ||||
-rw-r--r-- | test/apps/bun-install.sh | 89 | ||||
-rw-r--r-- | test/apps/bun-run-check-nameless-package.json | 6 | ||||
-rw-r--r-- | test/apps/bun-run-check-package.json | 7 | ||||
-rw-r--r-- | test/apps/bun-run-check.sh | 67 | ||||
-rw-r--r-- | test/bun.js/.prettierignore | 2 | ||||
-rwxr-xr-x | test/bun.js/bun.lockb | bin | 9454 -> 0 bytes | |||
-rw-r--r-- | test/bun.js/bunEnv.ts | 6 | ||||
-rw-r--r-- | test/bun.js/bunExe.ts | 3 | ||||
l--------- | test/bun.js/bundled/always-bundled-module/always-bundled-module | 1 | ||||
-rw-r--r-- | test/bun.js/bundled/always-bundled-module/cjs.js | 10 | ||||
-rw-r--r-- | test/bun.js/bundled/always-bundled-module/esm.js | 5 | ||||
-rw-r--r-- | test/bun.js/bundled/always-bundled-module/package.json | 4 | ||||
-rw-r--r-- | test/bun.js/bundled/entrypoint.ts | 13 | ||||
-rw-r--r-- | test/bun.js/bundled/package.json | 12 | ||||
-rw-r--r-- | test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/cjs.js | 10 | ||||
-rw-r--r-- | test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/esm.js | 5 | ||||
-rw-r--r-- | test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/package.json | 4 | ||||
-rw-r--r-- | test/bun.js/bundled/tsconfig.json | 6 | ||||
-rw-r--r-- | test/bun.js/file-importing-nonexistent-file.js | 1 | ||||
-rw-r--r-- | test/bun.js/google-fixture.html | 632 | ||||
-rw-r--r-- | test/bun.js/import.live.rexport.js | 2 | ||||
-rw-r--r-- | test/bun.js/module-require.snapshot.js | 1 | ||||
-rw-r--r-- | test/bun.js/package.json | 10 | ||||
-rw-r--r-- | test/bun.js/readdir.js | 9 | ||||
-rw-r--r-- | test/bun.js/snapshots.debug.js | 7 | ||||
-rw-r--r-- | test/bun.js/snapshots.js | 7 | ||||
-rw-r--r-- | test/bun.js/some-fs.js | 45 | ||||
-rw-r--r-- | test/bun.js/test-programs/bigpipe-r.c | 26 | ||||
-rw-r--r-- | test/bun.js/test-programs/bigpipe-w.c | 26 | ||||
-rw-r--r-- | test/bun.js/test_scope_debug.ts | 172 | ||||
-rw-r--r-- | test/bun.js/tiny-typed-emitter.snapshot.js | 7 | ||||
-rw-r--r-- | test/bun.js/tsconfig.json | 12 | ||||
-rwxr-xr-x | test/bun.lockb | bin | 0 -> 31909 bytes | |||
-rw-r--r-- | test/bundler/decorators.test.ts (renamed from test/bun.js/decorators.test.ts) | 0 | ||||
-rw-r--r-- | test/bundler/inline.macro.js (renamed from test/bun.js/inline.macro.js) | 0 | ||||
-rw-r--r-- | test/bundler/macro-check.js (renamed from test/bun.js/macro-check.js) | 0 | ||||
-rw-r--r-- | test/bundler/transpiler.test.js (renamed from test/bun.js/transpiler.test.js) | 0 | ||||
-rw-r--r-- | test/cli/hot/hot-runner-imported.js (renamed from test/bun.js/hot-runner-imported.js) | 0 | ||||
-rw-r--r-- | test/cli/hot/hot-runner.js (renamed from test/bun.js/hot-runner.js) | 0 | ||||
-rw-r--r-- | test/cli/hot/hot.test.ts (renamed from test/bun.js/hot.test.ts) | 3 | ||||
-rw-r--r-- | test/cli/install/bad-workspace.test.ts (renamed from test/bun.js/install/bad-workspace.test.ts) | 3 | ||||
-rw-r--r-- | test/cli/install/bar-0.0.2.tgz (renamed from test/bun.js/install/bar-0.0.2.tgz) | bin | 192 -> 192 bytes | |||
-rw-r--r-- | test/cli/install/baz-0.0.3.tgz (renamed from test/bun.js/install/baz-0.0.3.tgz) | bin | 283 -> 283 bytes | |||
-rw-r--r-- | test/cli/install/baz-0.0.5.tgz (renamed from test/bun.js/install/baz-0.0.5.tgz) | bin | 286 -> 286 bytes | |||
-rw-r--r-- | test/cli/install/bun-add.test.ts (renamed from test/bun.js/install/bun-add.test.ts) | 3 | ||||
-rw-r--r-- | test/cli/install/bun-install.test.ts (renamed from test/bun.js/install/bun-install.test.ts) | 3 | ||||
-rw-r--r-- | test/cli/install/bun-link.test.ts (renamed from test/bun.js/install/bun-link.test.ts) | 3 | ||||
-rw-r--r-- | test/cli/install/bun-pm.test.ts (renamed from test/bun.js/install/bun-pm.test.ts) | 3 | ||||
-rw-r--r-- | test/cli/install/bunx.test.ts (renamed from test/bun.js/install/bunx.test.ts) | 3 | ||||
-rw-r--r-- | test/cli/install/dummy.registry.ts (renamed from test/bun.js/install/dummy.registry.ts) | 0 | ||||
-rw-r--r-- | test/cli/install/moo-0.1.0.tgz (renamed from test/bun.js/install/moo-0.1.0.tgz) | bin | 197 -> 197 bytes | |||
-rw-r--r-- | test/cli/run/log-test.test.ts (renamed from test/bun.js/log-test.test.ts) | 3 | ||||
-rw-r--r-- | test/cli/run/preload-test.test.js (renamed from test/bun.js/preload-test.test.js) | 3 | ||||
-rwxr-xr-x | test/fixtures/bun-link-pkg-fixture/bun-link-pkg-fixture.js | 12 | ||||
-rwxr-xr-x | test/fixtures/bun-link-pkg-fixture/bun.lockb | bin | 1191 -> 0 bytes | |||
-rw-r--r-- | test/fixtures/bun-link-pkg-fixture/package-lock.json | 30 | ||||
-rw-r--r-- | test/fixtures/bun-link-pkg-fixture/package.json | 11 | ||||
-rw-r--r-- | test/fixtures/bun-link-to-pkg-fixture/.gitignore | 169 | ||||
-rw-r--r-- | test/fixtures/bun-link-to-pkg-fixture/README.md | 15 | ||||
-rwxr-xr-x | test/fixtures/bun-link-to-pkg-fixture/bun.lockb | bin | 1527 -> 0 bytes | |||
-rw-r--r-- | test/fixtures/bun-link-to-pkg-fixture/index.js | 1 | ||||
-rw-r--r-- | test/fixtures/bun-link-to-pkg-fixture/package.json | 12 | ||||
-rw-r--r-- | test/fixtures/bun-link-to-pkg-fixture/tsconfig.json | 14 | ||||
-rw-r--r-- | test/harness.ts (renamed from test/bun.js/gc.ts) | 13 | ||||
-rw-r--r-- | test/js/bun/console/console-iterator-run.js (renamed from test/bun.js/console/console-iterator-run.js) | 0 | ||||
-rw-r--r-- | test/js/bun/console/console-iterator.test.js (renamed from test/bun.js/console/console-iterator.test.js) | 2 | ||||
-rw-r--r-- | test/js/bun/dns/resolve-dns.test.ts (renamed from test/bun.js/resolve-dns.test.ts) | 4 | ||||
-rw-r--r-- | test/js/bun/ffi/ffi-test.c (renamed from test/bun.js/ffi-test.c) | 0 | ||||
-rw-r--r-- | test/js/bun/ffi/ffi.test.fixture.callback.c (renamed from test/bun.js/ffi.test.fixture.callback.c) | 3 | ||||
-rw-r--r-- | test/js/bun/ffi/ffi.test.fixture.receiver.c (renamed from test/bun.js/ffi.test.fixture.receiver.c) | 0 | ||||
-rw-r--r-- | test/js/bun/ffi/ffi.test.js (renamed from test/bun.js/ffi.test.js) | 15 | ||||
-rw-r--r-- | test/js/bun/globals.test.js (renamed from test/bun.js/globals.test.js) | 0 | ||||
-rw-r--r-- | test/js/bun/http/bun-server.test.ts (renamed from test/bun.js/bun-server.test.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/http/fetch.js.txt (renamed from test/bun.js/fetch.js.txt) | 0 | ||||
-rw-r--r-- | test/js/bun/http/fixture.html.gz (renamed from test/bun.js/fixture.html.gz) | bin | 16139 -> 16139 bytes | |||
-rw-r--r-- | test/js/bun/http/proxy.test.js (renamed from test/bun.js/proxy.test.js) | 2 | ||||
-rw-r--r-- | test/js/bun/http/serve.leak.ts (renamed from test/leaks/http-static-leak.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/http/serve.test.ts (renamed from test/bun.js/serve.test.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/io/bun-streams-test-fifo.sh (renamed from test/bun.js/bun-streams-test-fifo.sh) | 0 | ||||
-rw-r--r-- | test/js/bun/io/bun-write.test.js (renamed from test/bun.js/bun-write.test.js) | 2 | ||||
-rw-r--r-- | test/js/bun/io/emptyFile (renamed from test/bun.js/emptyFile) | 0 | ||||
-rw-r--r-- | test/js/bun/io/fetch.js.txt | 46 | ||||
-rw-r--r-- | test/js/bun/jsc/bun-jsc.test.js (renamed from test/bun.js/bun-jsc.test.js) | 0 | ||||
-rw-r--r-- | test/js/bun/jsc/shadow.test.js (renamed from test/bun.js/shadow.test.js) | 0 | ||||
-rw-r--r-- | test/js/bun/net/echo.js (renamed from test/bun.js/socket/echo.js) | 0 | ||||
-rw-r--r-- | test/js/bun/net/socket.test.ts (renamed from test/bun.js/socket/socket.test.ts) | 2 | ||||
-rw-r--r-- | test/js/bun/net/tcp-server.test.ts (renamed from test/bun.js/tcp-server.test.ts) | 2 | ||||
-rw-r--r-- | test/js/bun/plugin/hello.svelte (renamed from test/bun.js/hello.svelte) | 0 | ||||
-rw-r--r-- | test/js/bun/plugin/hello2.svelte (renamed from test/bun.js/hello2.svelte) | 0 | ||||
-rw-r--r-- | test/js/bun/plugin/plugins.d.ts (renamed from test/bun.js/plugins.d.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/plugin/plugins.test.ts (renamed from test/bun.js/plugins.test.ts) | 2 | ||||
-rw-r--r-- | test/js/bun/resolve/baz.js (renamed from test/bun.js/baz.js) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/file-importing-nonexistent-file.js | 1 | ||||
-rw-r--r-- | test/js/bun/resolve/first.mjs (renamed from test/bun.js/esm/first.mjs) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/import-meta.test.js (renamed from test/bun.js/import-meta.test.js) | 12 | ||||
-rw-r--r-- | test/js/bun/resolve/import-require-tla.js (renamed from test/bun.js/import-require-tla.js) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/import.live.decl.js (renamed from test/bun.js/import.live.decl.js) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/import.live.rexport-require.js (renamed from test/bun.js/import.live.rexport-require.js) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/import.live.rexport.js | 2 | ||||
-rw-r--r-- | test/js/bun/resolve/png/test-png-import.test.js (renamed from test/bun.js/test-png-import.test.js) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/png/test-png.png (renamed from test/bun.js/test-png.png) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/require-js-top-level-await.js (renamed from test/bun.js/require-js-top-level-await.js) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/require-js.js (renamed from test/bun.js/require-js.js) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/require-js2.js (renamed from test/bun.js/require-js2.js) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/require-json.json (renamed from test/bun.js/require-json.json) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/require-referenceerror.snapshot.js (renamed from test/bun.js/require-referenceerror.snapshot.js) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/resolve-error.test.ts (renamed from test/bun.js/resolve-error.test.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/resolve-typescript-file.tsx (renamed from test/bun.js/resolve-typescript-file.tsx) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/resolve.test.js (renamed from test/bun.js/resolve.test.js) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/second-child.mjs (renamed from test/bun.js/esm/second-child.mjs) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/second.mjs (renamed from test/bun.js/esm/second.mjs) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/startEnd.mjs (renamed from test/bun.js/esm/startEnd.mjs) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/third.mjs (renamed from test/bun.js/esm/third.mjs) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/toml/toml-fixture.toml (renamed from test/bun.js/toml-fixture.toml) | 0 | ||||
-rw-r--r-- | test/js/bun/resolve/toml/toml.test.js (renamed from test/bun.js/toml.test.js) | 2 | ||||
-rw-r--r-- | test/js/bun/spawn/bash-echo.sh (renamed from test/bun.js/bash-echo.sh) | 0 | ||||
-rw-r--r-- | test/js/bun/spawn/bun-spawn-test.js (renamed from test/bun.js/bun-spawn-test.js) | 0 | ||||
-rw-r--r-- | test/js/bun/spawn/exit-code-0.js (renamed from test/bun.js/exit-code-0.js) | 0 | ||||
-rw-r--r-- | test/js/bun/spawn/exit-code-1.js (renamed from test/bun.js/exit-code-1.js) | 0 | ||||
-rw-r--r-- | test/js/bun/spawn/exit-code-await-throw-1.js (renamed from test/bun.js/exit-code-await-throw-1.js) | 0 | ||||
-rw-r--r-- | test/js/bun/spawn/exit-code-unhandled-throw.js (renamed from test/bun.js/exit-code-unhandled-throw.js) | 0 | ||||
-rw-r--r-- | test/js/bun/spawn/exit-code.test.ts (renamed from test/bun.js/exit-code.test.ts) | 2 | ||||
-rw-r--r-- | test/js/bun/spawn/exit.js (renamed from test/bun.js/exit.js) | 0 | ||||
-rw-r--r-- | test/js/bun/spawn/spawn-streaming-stdin.test.ts (renamed from test/bun.js/spawn-streaming-stdin.test.ts) | 4 | ||||
-rw-r--r-- | test/js/bun/spawn/spawn-streaming-stdout-repro.js (renamed from test/bun.js/spawn-streaming-stdout-repro.js) | 0 | ||||
-rw-r--r-- | test/js/bun/spawn/spawn-streaming-stdout.test.ts (renamed from test/bun.js/spawn-streaming-stdout.test.ts) | 4 | ||||
-rw-r--r-- | test/js/bun/spawn/spawn.test.ts (renamed from test/bun.js/spawn.test.ts) | 3 | ||||
-rw-r--r-- | test/js/bun/spawn/stdin-repro.js (renamed from test/bun.js/stdin-repro.js) | 0 | ||||
-rw-r--r-- | test/js/bun/spawn/stdio-test-instance-a-lot.js (renamed from test/bun.js/stdio-test-instance-a-lot.js) | 0 | ||||
-rw-r--r-- | test/js/bun/spawn/stdio-test-instance.js (renamed from test/bun.js/stdio-test-instance.js) | 0 | ||||
-rw-r--r-- | test/js/bun/sqlite/northwind.testdb (renamed from test/bun.js/northwind.testdb) | bin | 602112 -> 602112 bytes | |||
-rw-r--r-- | test/js/bun/sqlite/sql-raw.test.js (renamed from test/bun.js/sql-raw.test.js) | 0 | ||||
-rw-r--r-- | test/js/bun/sqlite/sqlite-cross-process.js (renamed from test/bun.js/sqlite-cross-process.js) | 0 | ||||
-rw-r--r-- | test/js/bun/sqlite/sqlite.test.js (renamed from test/bun.js/sqlite.test.js) | 2 | ||||
-rw-r--r-- | test/js/bun/test/bigint.test.js (renamed from test/bun.js/bigint.test.js) | 0 | ||||
-rw-r--r-- | test/js/bun/test/bun-test.test.ts (renamed from test/bun.js/bun-test.test.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/test/jest-doesnt-auto-import.js (renamed from test/bun.js/jest-doesnt-auto-import.js) | 0 | ||||
-rw-r--r-- | test/js/bun/test/jest-hooks.test.ts (renamed from test/bun.js/bun-test/jest-hooks.test.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/test/nested-describes.test.ts (renamed from test/bun.js/bun-test/nested-describes.test.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/test/test-auto-import-jest-globals.test.js (renamed from test/bun.js/test-auto-import-jest-globals.test.js) | 0 | ||||
-rw-r--r-- | test/js/bun/test/test-test.test.ts (renamed from test/bun.js/test-test.test.ts) | 3 | ||||
-rw-r--r-- | test/js/bun/util/arraybuffersink.test.ts (renamed from test/bun.js/arraybuffersink.test.ts) | 2 | ||||
-rw-r--r-- | test/js/bun/util/concat.test.js (renamed from test/bun.js/concat.test.js) | 1 | ||||
-rw-r--r-- | test/js/bun/util/empty.js (renamed from test/bun.js/empty.js) | 0 | ||||
-rw-r--r-- | test/js/bun/util/escapeHTML.test.js (renamed from test/bun.js/escapeHTML.test.js) | 1 | ||||
-rw-r--r-- | test/js/bun/util/fileUrl.test.js (renamed from test/bun.js/fileUrl.test.js) | 0 | ||||
-rw-r--r-- | test/js/bun/util/filesink.test.ts (renamed from test/bun.js/filesink.test.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/util/filesystem_router.test.ts (renamed from test/bun.js/filesystem_router.test.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/util/hash.test.js (renamed from test/bun.js/hash.test.js) | 2 | ||||
-rw-r--r-- | test/js/bun/util/index-of-line.test.ts (renamed from test/bun.js/index-of-line.test.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/util/inspect.test.js (renamed from test/bun.js/inspect.test.js) | 2 | ||||
-rw-r--r-- | test/js/bun/util/mmap.test.js (renamed from test/bun.js/mmap.test.js) | 2 | ||||
-rw-r--r-- | test/js/bun/util/peek.test.ts (renamed from test/bun.js/peek.test.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/util/reportError.test.js (renamed from test/bun.js/reportError.test.js) | 0 | ||||
-rw-r--r-- | test/js/bun/util/sleep.js (renamed from test/bun.js/sleep.js) | 0 | ||||
-rw-r--r-- | test/js/bun/util/sleepSync.test.ts (renamed from test/bun.js/sleepSync.test.ts) | 0 | ||||
-rw-r--r-- | test/js/bun/util/unsafe.test.js (renamed from test/bun.js/unsafe.test.js) | 2 | ||||
-rw-r--r-- | test/js/bun/util/which.test.ts (renamed from test/bun.js/which.test.ts) | 0 | ||||
-rwxr-xr-x | test/js/bun/wasm/hello-wasi.wasm (renamed from test/bun.js/hello-wasi.wasm) | bin | 131 -> 131 bytes | |||
-rw-r--r-- | test/js/bun/wasm/wasi.test.js (renamed from test/bun.js/wasi.test.js) | 3 | ||||
-rw-r--r-- | test/js/bun/wasm/wasm-return-1-test.zig (renamed from test/bun.js/wasm-return-1-test.zig) | 0 | ||||
-rw-r--r-- | test/js/bun/wasm/wasm.js (renamed from test/bun.js/wasm.js) | 0 | ||||
-rw-r--r-- | test/js/bun/websocket/websocket-server.test.ts (renamed from test/bun.js/websocket-server.test.ts) | 51 | ||||
-rw-r--r-- | test/js/first_party/undici/undici.test.ts (renamed from test/bun.js/undici.test.ts) | 0 | ||||
-rw-r--r-- | test/js/node/assert/assert-test.test.ts (renamed from test/bun.js/assert-test.test.ts) | 0 | ||||
-rw-r--r-- | test/js/node/buffer.test.js (renamed from test/bun.js/buffer.test.js) | 2 | ||||
-rw-r--r-- | test/js/node/child_process/child-process-stdio.test.js (renamed from test/bun.js/child-process-stdio.test.js) | 3 | ||||
-rw-r--r-- | test/js/node/child_process/child_process-node.test.js (renamed from test/bun.js/child_process-node.test.js) | 3 | ||||
-rw-r--r-- | test/js/node/child_process/child_process.test.ts (renamed from test/bun.js/child_process.test.ts) | 2 | ||||
-rw-r--r-- | test/js/node/child_process/readFileSync.txt (renamed from test/bun.js/readFileSync.txt) | 0 | ||||
-rw-r--r-- | test/js/node/child_process/spawned-child.js (renamed from test/bun.js/spawned-child.js) | 0 | ||||
-rw-r--r-- | test/js/node/crypto/crypto-scrypt.test.js (renamed from test/bun.js/crypto-scrypt.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/crypto/crypto.test.js (renamed from test/bun.js/crypto.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/crypto/node-crypto.test.js (renamed from test/bun.js/node-crypto.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/dirname.test.js (renamed from test/bun.js/dirname.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/disabled-module.test.js (renamed from test/bun.js/disabled-module.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/dns/dns.node.mjs (renamed from test/bun.js/dns.node.mjs) | 0 | ||||
-rw-r--r-- | test/js/node/dns/node-dns.test.js (renamed from test/bun.js/node-dns.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/events/event-emitter.test.ts (renamed from test/bun.js/event-emitter.test.ts) | 0 | ||||
-rw-r--r-- | test/js/node/events/node-builtins.test.js (renamed from test/bun.js/node-builtins.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/fs/export-*-from.ts (renamed from test/fixtures/export-lazy-fs-streams/export-*-from.ts) | 0 | ||||
-rw-r--r-- | test/js/node/fs/export-from.ts (renamed from test/fixtures/export-lazy-fs-streams/export-from.ts) | 0 | ||||
-rw-r--r-- | test/js/node/fs/fs-stream.js (renamed from test/bun.js/fs-stream.js) | 0 | ||||
l--------- | test/js/node/fs/fs-stream.link.js (renamed from test/bun.js/fs-stream.link.js) | 0 | ||||
-rw-r--r-- | test/js/node/fs/fs.test.ts (renamed from test/bun.js/fs.test.ts) | 9 | ||||
-rw-r--r-- | test/js/node/fs/readFileSync.txt | 1 | ||||
-rw-r--r-- | test/js/node/fs/test.txt | 0 | ||||
-rw-r--r-- | test/js/node/fs/writeFileSync.txt (renamed from test/bun.js/writeFileSync.txt) | 0 | ||||
-rw-r--r-- | test/js/node/harness.test.js (renamed from test/bun.js/node-test-helpers.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/harness.ts (renamed from test/bun.js/node-test-helpers.ts) | 3 | ||||
-rw-r--r-- | test/js/node/http/node-http.fixme.ts (renamed from test/bun.js/node-http.test.ts) | 49 | ||||
-rw-r--r-- | test/js/node/module/node-module-module.test.js (renamed from test/bun.js/node-module-module.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/net/node-net.test.ts (renamed from test/bun.js/socket/node-net.test.ts) | 0 | ||||
-rw-r--r-- | test/js/node/os/os.test.js (renamed from test/bun.js/os.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/path/path.test.js (renamed from test/bun.js/path.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/process/print-process-args.js (renamed from test/bun.js/print-process-args.js) | 0 | ||||
-rw-r--r-- | test/js/node/process/process-args.test.js (renamed from test/bun.js/process-args.test.js) | 2 | ||||
-rw-r--r-- | test/js/node/process/process-nexttick.js (renamed from test/bun.js/process-nexttick.js) | 0 | ||||
-rw-r--r-- | test/js/node/process/process-nexttick.test.js (renamed from test/bun.js/process-nexttick.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/process/process-stdin-echo.js (renamed from test/bun.js/process-stdin-echo.js) | 0 | ||||
-rw-r--r-- | test/js/node/process/process-stdio.test.ts (renamed from test/bun.js/process-stdio.test.ts) | 2 | ||||
-rw-r--r-- | test/js/node/process/process.test.js (renamed from test/bun.js/process.test.js) | 5 | ||||
-rw-r--r-- | test/js/node/readline/readline.node.test.ts (renamed from test/bun.js/readline.node.test.ts) | 2 | ||||
-rw-r--r-- | test/js/node/readline/readline_promises.node.test.ts (renamed from test/bun.js/readline_promises.node.test.ts) | 2 | ||||
-rw-r--r-- | test/js/node/stream/bufferlist.test.ts (renamed from test/bun.js/bufferlist.test.ts) | 0 | ||||
-rw-r--r-- | test/js/node/stream/node-stream-uint8array.test.ts (renamed from test/bun.js/node-stream-uint8array.test.ts) | 0 | ||||
-rw-r--r-- | test/js/node/stream/node-stream.test.js (renamed from test/bun.js/node-stream.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/string_decoder/string-decoder.test.js (renamed from test/bun.js/string-decoder.test.js) | 2 | ||||
-rw-r--r-- | test/js/node/timers/node-timers.test.ts (renamed from test/bun.js/node-timers.test.ts) | 0 | ||||
-rw-r--r-- | test/js/node/util/test-util-types.test.js (renamed from test/bun.js/test-util-types.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/util/util-promisify.test.js (renamed from test/bun.js/util/util-promisify.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/util/util.test.js (renamed from test/bun.js/util/util.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/v8/capture-stack-trace.test.js (renamed from test/bun.js/capture-stack-trace.test.js) | 0 | ||||
-rw-r--r-- | test/js/node/zlib/fixture.html.gz | bin | 0 -> 16139 bytes | |||
-rw-r--r-- | test/js/node/zlib/zlib.test.js (renamed from test/bun.js/zlib.test.js) | 0 | ||||
-rwxr-xr-x | test/js/third_party/body-parser/bun.lockb (renamed from test/bun.js/third-party/body-parser-test/bun.lockb) | bin | 19805 -> 19805 bytes | |||
-rw-r--r-- | test/js/third_party/body-parser/express-body-parser-test.test.ts (renamed from test/bun.js/third-party/body-parser-test/express-body-parser-test.test.ts) | 0 | ||||
-rw-r--r-- | test/js/third_party/body-parser/package.json (renamed from test/bun.js/third-party/body-parser-test/package.json) | 0 | ||||
-rwxr-xr-x | test/js/third_party/esbuild/bun.lockb | bin | 0 -> 8425 bytes | |||
-rw-r--r-- | test/js/third_party/esbuild/esbuild-child_process.test.ts (renamed from test/bun.js/esbuild-child_process.test.ts) | 2 | ||||
-rw-r--r-- | test/js/third_party/esbuild/esbuild-test.js (renamed from test/bun.js/esbuild-test.js) | 0 | ||||
-rw-r--r-- | test/js/third_party/esbuild/package.json | 6 | ||||
-rwxr-xr-x | test/js/third_party/napi_create_external/bun.lockb (renamed from test/bun.js/third-party/napi_create_external/bun.lockb) | bin | 1496 -> 1496 bytes | |||
-rw-r--r-- | test/js/third_party/napi_create_external/napi-create-external.test.ts (renamed from test/bun.js/third-party/napi_create_external/napi-create-external.test.ts) | 2 | ||||
-rw-r--r-- | test/js/third_party/napi_create_external/package.json (renamed from test/bun.js/third-party/napi_create_external/package.json) | 1 | ||||
-rw-r--r-- | test/js/third_party/react-dom/react-dom-server.bun.cjs (renamed from test/bun.js/react-dom-server.bun.cjs) | 0 | ||||
-rw-r--r-- | test/js/third_party/react-dom/react-dom.test.tsx (renamed from test/bun.js/react-dom.test.tsx) | 2 | ||||
-rw-r--r-- | test/js/third_party/svelte/bun-loader-svelte.ts (renamed from test/bun.js/bun-loader-svelte/bun-loader-svelte.ts) | 0 | ||||
-rw-r--r-- | test/js/third_party/svelte/hello.svelte | 5 | ||||
-rw-r--r-- | test/js/third_party/svelte/package.json (renamed from test/bun.js/bun-loader-svelte/package.json) | 0 | ||||
-rw-r--r-- | test/js/third_party/svelte/svelte.test.ts | 21 | ||||
-rw-r--r-- | test/js/web/abort/abort-signal-timeout.test.js (renamed from test/bun.js/abort-signal-timeout.test.js) | 0 | ||||
-rw-r--r-- | test/js/web/console/console-log.expected.txt (renamed from test/bun.js/console/console-log.expected.txt) | 0 | ||||
-rw-r--r-- | test/js/web/console/console-log.js (renamed from test/bun.js/console/console-log.js) | 0 | ||||
-rw-r--r-- | test/js/web/console/console-log.test.ts (renamed from test/bun.js/console/console-log.test.ts) | 2 | ||||
-rw-r--r-- | test/js/web/crypto/web-crypto.test.ts (renamed from test/bun.js/web-crypto.test.ts) | 0 | ||||
-rw-r--r-- | test/js/web/encoding/text-decoder.test.js (renamed from test/bun.js/text-decoder.test.js) | 2 | ||||
-rw-r--r-- | test/js/web/encoding/text-encoder.test.js (renamed from test/bun.js/text-encoder.test.js) | 2 | ||||
-rw-r--r-- | test/js/web/encoding/utf8-encoding-fixture.bin (renamed from test/bun.js/utf8-encoding-fixture.bin) | bin | 4456448 -> 4456448 bytes | |||
-rw-r--r-- | test/js/web/fetch/body-mixin-errors.test.ts (renamed from test/bun.js/body-mixin-errors.test.ts) | 0 | ||||
-rw-r--r-- | test/js/web/fetch/body-stream.test.ts (renamed from test/bun.js/body-stream.test.ts) | 0 | ||||
-rw-r--r-- | test/js/web/fetch/fetch-gzip.test.ts (renamed from test/bun.js/fetch-gzip.test.ts) | 2 | ||||
-rw-r--r-- | test/js/web/fetch/fetch.js.txt | 46 | ||||
-rw-r--r-- | test/js/web/fetch/fetch.test.ts (renamed from test/bun.js/fetch.test.ts) | 2 | ||||
-rw-r--r-- | test/js/web/fetch/fetch_headers.test.js (renamed from test/bun.js/fetch_headers.test.js) | 0 | ||||
-rw-r--r-- | test/js/web/fetch/fixture.html (renamed from test/bun.js/fixture.html) | 0 | ||||
-rw-r--r-- | test/js/web/fetch/fixture.html.gz | bin | 0 -> 16139 bytes | |||
-rw-r--r-- | test/js/web/html/FormData.test.ts (renamed from test/bun.js/FormData.test.ts) | 2 | ||||
-rw-r--r-- | test/js/web/html/form-data-fixture.txt (renamed from test/bun.js/form-data-fixture.txt) | 0 | ||||
-rw-r--r-- | test/js/web/streams/bun-streams-test-fifo.sh | 8 | ||||
-rw-r--r-- | test/js/web/streams/fetch.js.txt | 46 | ||||
-rw-r--r-- | test/js/web/streams/streams.test.js (renamed from test/bun.js/streams.test.js) | 2 | ||||
-rw-r--r-- | test/js/web/timers/microtask.test.js (renamed from test/bun.js/microtask.test.js) | 0 | ||||
-rw-r--r-- | test/js/web/timers/performance.test.js (renamed from test/bun.js/performance.test.js) | 0 | ||||
-rw-r--r-- | test/js/web/timers/setImmediate.test.js (renamed from test/bun.js/setImmediate.test.js) | 0 | ||||
-rw-r--r-- | test/js/web/timers/setInterval.test.js (renamed from test/bun.js/setInterval.test.js) | 0 | ||||
-rw-r--r-- | test/js/web/timers/setTimeout.test.js (renamed from test/bun.js/setTimeout.test.js) | 0 | ||||
-rw-r--r-- | test/js/web/url/url.test.ts (renamed from test/bun.js/url.test.ts) | 0 | ||||
-rw-r--r-- | test/js/web/util/atob.test.js (renamed from test/bun.js/atob.test.js) | 0 | ||||
-rw-r--r-- | test/js/web/web-globals.test.js (renamed from test/bun.js/web-globals.test.js) | 2 | ||||
-rw-r--r-- | test/js/web/websocket/websocket-subprocess.ts (renamed from test/bun.js/websocket-subprocess.ts) | 0 | ||||
-rw-r--r-- | test/js/web/websocket/websocket.test.js (renamed from test/bun.js/websocket.test.js) | 5 | ||||
-rw-r--r-- | test/js/workerd/html-rewriter.test.js (renamed from test/bun.js/html-rewriter.test.js) | 2 | ||||
-rw-r--r-- | test/macro/assert.tsx | 4 | ||||
-rw-r--r-- | test/macro/fetchSync.tsx | 9 | ||||
-rw-r--r-- | test/macro/hello-fetch-macro.tsx | 5 | ||||
-rw-r--r-- | test/macro/loadMocks.tsx | 29 | ||||
-rw-r--r-- | test/macro/macro.d.ts | 1 | ||||
-rw-r--r-- | test/mkfifo.ts (renamed from test/bun.js/mkfifo.ts) | 0 | ||||
-rw-r--r-- | test/package.json | 19 | ||||
-rw-r--r-- | test/regression/issue/00631.test.ts (renamed from test/bun.js/repro_631.test.js) | 10 | ||||
-rw-r--r-- | test/regression/issue/02005.test.ts (renamed from test/bun.js/repro_2005.test.js) | 2 | ||||
-rw-r--r-- | test/tsconfig.json | 23 | ||||
-rw-r--r-- | tsconfig.json | 2 |
293 files changed, 433 insertions, 2321 deletions
diff --git a/.github/workflows/bun-linux-build.yml b/.github/workflows/bun-linux-build.yml index 75c84c7f6..07d770354 100644 --- a/.github/workflows/bun-linux-build.yml +++ b/.github/workflows/bun-linux-build.yml @@ -188,9 +188,7 @@ jobs: # if: ${{github.event.inputs.use_bun == 'false'}} run: | bun install - bun install --cwd test/bun.js - bun install --cwd test/bun.js/third-party/body-parser-test - #bun install --cwd test/bun.js/third-party/napi_create_external + bun install --cwd test bun install --cwd packages/bun-internal-test node packages/bun-internal-test/src/runner.node.mjs || true - name: Comment on PR diff --git a/.github/workflows/bun-mac-x64-baseline.yml b/.github/workflows/bun-mac-x64-baseline.yml index c4309a66c..b2430e93b 100644 --- a/.github/workflows/bun-mac-x64-baseline.yml +++ b/.github/workflows/bun-mac-x64-baseline.yml @@ -428,9 +428,7 @@ jobs: # if: ${{github.event.inputs.use_bun == 'false'}} run: | bun install - bun install --cwd test/bun.js - bun install --cwd test/bun.js/third-party/body-parser-test - #bun install --cwd test/bun.js/third-party/napi_create_external + bun install --cwd test bun install --cwd packages/bun-internal-test node packages/bun-internal-test/src/runner.node.mjs || true - name: Comment on PR diff --git a/.gitignore b/.gitignore index 79930b44e..49fb9c41d 100644 --- a/.gitignore +++ b/.gitignore @@ -112,3 +112,5 @@ src/deps/c-ares/build src/bun.js/debug-bindings-obj failing-tests.txt +test.txt +myscript.sh
\ No newline at end of file diff --git a/.prettierignore b/.prettierignore index b9249b91c..464309eab 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,11 +1,4 @@ src/fallback.html -# src/test -test/bun.js/solid-dom-fixtures -test/bun.js/bundled -#src/bun.js/builtins -# src/api/demo -test/snapshots -test/snapshots-no-hmr src/bun.js/WebKit src/bun.js/builtins/js src/*.out.js @@ -13,3 +6,5 @@ src/*out.*.js src/deps src/test/fixtures src/react-refresh.js +test/snapshots +test/snapshots-no-hmr @@ -590,8 +590,7 @@ release-types: .PHONY: format format: ## to format the code - -$(PRETTIER) --write 'test/bun.js/*.{js,jsx,ts,tsx}' - -$(PRETTIER) --write 'test/bun.js/solid-dom-fixtures/**/*.{js,jsx,ts,tsx}' + -$(PRETTIER) --write 'test/**/*.{js,jsx,ts,tsx}' .PHONY: lolhtml @@ -619,7 +618,7 @@ boringssl-debug: boringssl-build-debug boringssl-copy .PHONY: compile-ffi-test compile-ffi-test: - clang $(OPTIMIZATION_LEVEL) -shared -undefined dynamic_lookup -o /tmp/bun-ffi-test.dylib -fPIC ./test/bun.js/ffi-test.c + clang $(OPTIMIZATION_LEVEL) -shared -undefined dynamic_lookup -o /tmp/bun-ffi-test.dylib -fPIC ./test/js/bun/ffi/ffi-test.c sqlite: @@ -1095,45 +1094,8 @@ dev: mkdir-dev dev-obj bun-link-lld-debug mkdir-dev: mkdir -p $(DEBUG_PACKAGE_DIR)/bin -test-install: - cd test/scripts && $(NPM_CLIENT) install - -.PHONY: test-bun-dev -test-bun-dev: - BUN_BIN=$(RELEASE_BUN) bash test/apps/bun-dev.sh - BUN_BIN=$(RELEASE_BUN) bash test/apps/bun-dev-index-html.sh - -.PHONY: test-dev-bun-dev -test-dev-bun-dev: - BUN_BIN=$(DEBUG_BUN) bash test/apps/bun-dev.sh - BUN_BIN=$(DEBUG_BUN) bash test/apps/bun-dev-index-html.sh - -.PHONY: test-bun-snapshot -test-bun-snapshot: - rm -rf test/bun.js/snapshots.js - touch test/bun.js/snapshots.js - $(foreach i,$(wildcard test/bun.js/*.snapshot.*),echo "" >> test/bun.js/snapshots.js; echo "// $i" >> test/bun.js/snapshots.js; $(RELEASE_BUN) build $i --platform=bun >> test/bun.js/snapshots.js;) - -.PHONY: test-dev-bun-snapshot -test-dev-bun-snapshot: - rm -rf test/bun.js/snapshots.debug.js - touch test/bun.js/snapshots.debug.js - $(foreach i,$(wildcard test/bun.js/*.snapshot.*),echo "" >> test/bun.js/snapshots.debug.js; echo "// $i" >> test/bun.js/snapshots.debug.js; $(DEBUG_BUN) build $i --platform=bun >> test/bun.js/snapshots.debug.js;) - -.PHONY: test-bun-init -test-bun-init: - BUN_BIN=$(RELEASE_BUN) bash test/apps/bun-init-check.sh - -.PHONY: test-dev-bun-init -test-dev-bun-init: - BUN_BIN=$(DEBUG_BUN) bash test/apps/bun-init-check.sh - -.PHONY: test-bun-wiptest -test-bun-wiptest: test/wiptest/run - cd test/wiptest && BUN_BIN=$(DEBUG_BUN) ./run ./fixtures - -.PHONY: test-all -test-all: test-install test-bun-snapshot test-with-hmr test-no-hmr test-create-next test-create-react test-bun-run test-bun-install test-bun-dev test-bun-init +test-all: + $(RELEASE_BUN) test .PHONY: copy-test-node-modules copy-test-node-modules: @@ -1144,73 +1106,6 @@ copy-test-node-modules: kill-bun: -killall -9 bun bun-debug -.PHONY: test-dev-create-next -test-dev-create-next: - BUN_BIN=$(DEBUG_BUN) bash test/apps/bun-create-next.sh - -.PHONY: test-dev-create-react -test-dev-create-react: - BUN_BIN=$(DEBUG_BUN) bash test/apps/bun-create-react.sh - -.PHONY: test-create-next -test-create-next: - BUN_BIN=$(RELEASE_BUN) bash test/apps/bun-create-next.sh - -.PHONY: test-bun-run -test-bun-run: - cd test/apps && BUN_BIN=$(RELEASE_BUN) bash ./bun-run-check.sh - -.PHONY: test-bun-install -test-bun-install: test-bun-install-git-status - cd test/apps && JS_RUNTIME=$(RELEASE_BUN) NPM_CLIENT=$(RELEASE_BUN) bash ./bun-install.sh - cd test/apps && BUN_BIN=$(RELEASE_BUN) bash ./bun-install-utf8.sh - -.PHONY: test-bun-install-git-status -test-bun-install-git-status: - cd test/apps && JS_RUNTIME=$(RELEASE_BUN) BUN_BIN=$(RELEASE_BUN) bash ./bun-install-lockfile-status.sh - -.PHONY: test-dev-bun-install -test-dev-bun-install: test-dev-bun-install-git-status - cd test/apps && JS_RUNTIME=$(DEBUG_BUN) NPM_CLIENT=$(DEBUG_BUN) bash ./bun-install.sh - cd test/apps && BUN_BIN=$(DEBUG_BUN) bash ./bun-install-utf8.sh - -.PHONY: test-dev-bun-install-git-status -test-dev-bun-install-git-status: - cd test/apps && BUN_BIN=$(DEBUG_BUN) bash ./bun-install-lockfile-status.sh - -.PHONY: test-create-react -test-create-react: - BUN_BIN=$(RELEASE_BUN) bash test/apps/bun-create-react.sh - -.PHONY: test-with-hmr -test-with-hmr: kill-bun copy-test-node-modules - BUN_BIN=$(RELEASE_BUN) node test/scripts/browser.js - -.PHONY: test-no-hmr -test-no-hmr: kill-bun copy-test-node-modules - -killall bun -9; - DISABLE_HMR="DISABLE_HMR" BUN_BIN=$(RELEASE_BUN) node test/scripts/browser.js - -.PHONY: test-dev-with-hmr -test-dev-with-hmr: copy-test-node-modules - -killall bun-debug -9; - BUN_BIN=$(DEBUG_BUN) node test/scripts/browser.js - -.PHONY: test-dev-no-hmr -test-dev-no-hmr: copy-test-node-modules - -killall bun-debug -9; - DISABLE_HMR="DISABLE_HMR" BUN_BIN=$(DEBUG_BUN) node test/scripts/browser.js - -.PHONY: test-dev-bun-hmr -test-dev-bun-run: - cd test/apps && BUN_BIN=$(DEBUG_BUN) bash bun-run-check.sh - -.PHONY: test-dev-all -test-dev-all: test-install test-dev-bun-snapshot test-dev-with-hmr test-dev-no-hmr test-dev-create-next test-dev-create-react test-dev-bun-run test-dev-bun-install test-dev-bun-dev test-dev-bun-init -test-dev-bunjs: - -test-dev: test-dev-with-hmr - jsc-copy-headers: cp $(WEBKIT_DIR)/Source/JavaScriptCore/heap/WeakHandleOwner.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/WeakHandleOwner.h cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/LazyClassStructureInlines.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/LazyClassStructureInlines.h diff --git a/bunfig.toml b/bunfig.toml index 8c6c75190..4e205af4f 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,8 +1,8 @@ [test] # Large monorepos (like Bun) may want to specify the test directory more specifically -# By default, `bun wiptest` scans every single folder recurisvely which, if you +# By default, `bun test` scans every single folder recurisvely which, if you # have a gigantic submodule (like WebKit), it has to do lots of directory # traversals # # Instead, we can just make it scan only the test directory for Bun's runtime tests -root = "test/bun.js" +root = "test" diff --git a/packages/bun-internal-test/package.json b/packages/bun-internal-test/package.json index 6504f57b4..accc76f77 100644 --- a/packages/bun-internal-test/package.json +++ b/packages/bun-internal-test/package.json @@ -1,5 +1,6 @@ { "private": true, + "type": "module", "dependencies": { "@actions/core": "^1.10.0" }, @@ -8,6 +9,6 @@ "prettier": "^2.8.2" }, "scripts": { - "test": "bun run src/runner.ts" + "test": "node src/runner.node.mjs" } } diff --git a/packages/bun-internal-test/src/runner.node.mjs b/packages/bun-internal-test/src/runner.node.mjs index 135ee246e..eca8a9bb1 100644 --- a/packages/bun-internal-test/src/runner.node.mjs +++ b/packages/bun-internal-test/src/runner.node.mjs @@ -129,7 +129,7 @@ function findErrors(data) { } var tests = []; var testFileNames = []; -for (const path of findTests(resolve(cwd, "test/bun.js"))) { +for (const path of findTests(resolve(cwd, "test"))) { testFileNames.push(path); tests.push(runTest(path).catch(console.error)); } diff --git a/packages/bun-internal-test/src/runner.ts b/packages/bun-internal-test/src/runner.ts deleted file mode 100644 index 4b660fe23..000000000 --- a/packages/bun-internal-test/src/runner.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { ArrayBufferSink, spawn } from "bun"; -import { readdirSync, openSync, writeSync, truncateSync } from "node:fs"; -import { resolve } from "node:path"; -import * as action from "@actions/core"; -import { StringDecoder } from "node:string_decoder"; - -const cwd = resolve("../.."); -process.chdir(cwd); - -const isAction = !!process.env["GITHUB_ACTION"]; -const errorPattern = /error: ([\S\s]*?)(?=\n.*?at (\/.*):(\d+):(\d+))/gim; - -function* findTests(dir: string, query?: string): Generator<string> { - for (const entry of readdirSync(resolve(dir), { encoding: "utf-8", withFileTypes: true })) { - const path = resolve(dir, entry.name); - if (path.includes("node_modules")) continue; - - if (entry.isDirectory()) { - yield* findTests(path, query); - } else if (entry.isFile() && entry.name.includes(".test.")) { - yield path; - } - } -} - -async function runTest(path: string): Promise<void> { - const name = path.replace(cwd, "").slice(1); - const runner = spawn({ - cmd: ["bun", "test", path], - stdout: "pipe", - stderr: "pipe", - stdin: "ignore", - env: { - ...process.env, - FORCE_COLOR: "1", - }, - }); - const exitCode = await Promise.race([ - new Promise(resolve => { - setTimeout(() => { - runner.kill(); - resolve(124); // Timed Out - }, 60_000); - }), - runner.exited, - ]); - if (isAction) { - const prefix = exitCode === 0 ? "PASS" : `FAIL (exit code ${exitCode})`; - action.startGroup(`${prefix} - ${name}`); - } - for (const stdout of [runner.stdout, runner.stderr]) { - if (!stdout) { - continue; - } - const reader = stdout.getReader(); - while (true) { - const { value, done } = await reader.read(); - if (value) { - console.write(value); - if (isAction) { - findErrors(value); - } - } - if (done) { - break; - } - } - } - if (isAction) { - action.endGroup(); - } -} - -let failed = false; - -function findErrors(data: Uint8Array): void { - const text = new StringDecoder().write(new Buffer(data.buffer)); - for (const [message, _, path, line, col] of text.matchAll(errorPattern)) { - failed = true; - action.error(message, { - file: path.replace(cwd, "").slice(1), - startLine: parseInt(line), - startColumn: parseInt(col), - }); - } - Bun.gc(true); -} - -const tests = []; -for (const path of findTests(resolve(cwd, "test/bun.js"))) { - tests.push(runTest(path).catch(console.error)); -} -await Promise.allSettled(tests); -process.exit(failed ? 1 : 0); diff --git a/packages/bun-internal-test/tsconfig.json b/packages/bun-internal-test/tsconfig.json index 1b2f41220..860a9d365 100644 --- a/packages/bun-internal-test/tsconfig.json +++ b/packages/bun-internal-test/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "noEmit": true, "lib": ["ESNext"], "module": "ESNext", "target": "ESNext", diff --git a/test/fixtures/bun-link-pkg-fixture/.gitignore b/test/.prettierignore index 6455d29a6..3c3629e64 100644 --- a/test/fixtures/bun-link-pkg-fixture/.gitignore +++ b/test/.prettierignore @@ -1,2 +1 @@ node_modules -*.bunlockb diff --git a/test/README.md b/test/README.md index 274b19fbf..36fe3b005 100644 --- a/test/README.md +++ b/test/README.md @@ -1,145 +1,73 @@ -# Tests in Bun +# Tests -Bun currently has four different kinds of tests +## Finding tests -To run all the tests: +Tests are located in the [`test/`](test/) directory and are organized using the following structure: -```bash -make test-all -bun --cwd=test/bun.js wiptest -``` - -### Runtime tests - -To run the runtime tests: +* `test/` + * `js/` - tests for JavaScript APIs. + * `cli/` - tests for commands, configs, and stdout. + * `bundler/` - tests for the transpiler/bundler. + * `regression/` - tests that reproduce a specific issue. + * `harness.ts` - utility functions that can be imported from any test. -```bash -cd test/bun.js -bun wiptest -``` +The tests in [`test/js/`](test/js/) directory are further categorized by the type of API. -These tests are in [./bun.js](./bun.js) and are files with `.test.js` or `.test.ts` in the filename. +* `test/js/` + * `bun/` - tests for `Bun`-specific APIs. + * `node/` - tests for Node.js APIs. + * `web/` - tests for Web APIs, like `fetch()`. + * `first_party/` - tests for npm packages that are built-in, like `undici`. + * `third_party/` - tests for npm packages that are not built-in, but are popular, like `esbuild`. -These test that the runtime behaves as expected. These also test the transpiler, both because test files are transpiled and directly by running the transpiler via `Bun.Transpiler`. +## Running tests -#### Adding a new test +To run a test, use Bun's built-in test command: `bun test`. -1. Create a new file in [./bun.js](./bun.js/) with `.test` in the name. +```sh +bun test # Run all tests +bun test js/bun # Only run tests in a directory +bun test sqlite.test.ts # Only run a specific test +``` -These test use `bun:test` as the import (though you can also import from `vitest` or jest and it will work). +If you encounter lots of errors, try running `bun install`, then trying again. -This will eventually be a public test runner for bun, but the reporter isn't very good yet and it doesn't run in parallel. +## Writing tests -The syntax intends for Jest compatibility. +Tests are written in TypeScript (preferred) or JavaScript using Jest's `describe()`, `test()`, and `expect()` APIs. ```ts -import { describe, expect, it } from "bun:test"; - -describe("Example", () => { - it("should work", () => { - expect(1).toBe(1); +import { describe, test, expect } from "bun:test"; +import { gcTick } from "harness"; + +describe("TextEncoder", () => { + test("can encode a string", async () => { + const encoder = new TextEncoder(); + const actual = encoder.encode("bun"); + await gcTick(); + expect(actual).toBe(new Uint8Array([0x62, 0x75, 0x6E])); }); }); ``` -### Browser tests - -Browser tests run end-to-end inside of Puppeteer and execute code transpiled by `bun dev`. These tests are in [./snippets](./snippets). - -The interface is: - -```js -// this function is called after import() -// if testDone() is never called, the test fails -export function test() { - return testDone(import.meta.url); -} -``` - -On success, it saves a snapshot to [./snapshots](./snapshots) which is checked into git. - -#### Adding a new test - -1. Create a new file in the `snippets` directory. -2. Append the filename to [./scripts/snippets.json](./scripts/snippets.json) -3. Run `bun dev` inside this folder in one terminal window -4. Run `make integration-test-dev` - -These tests are run twice. Once with HMR enabled and once with HMR disabled. HMR changes the output enough to warrant it's own special treatment. - -#### Running the tests - -To run the browser tests with HMR on a production build: - -```bash -make test-with-hmr -``` - -To run the browser tests without HMR on a production build: - -```bash -make test-with-no-hmr -``` - -To run the browser tests with HMR on a debug build: - -```bash -make test-dev-with-hmr -``` - -To run the browser tests without HMR on a debug build: +If you are fixing a bug that was reported from a GitHub issue, remember to add a test in the `test/regression/` directory. -```bash -make test-dev-no-hmr -``` +```ts +// test/regression/issue/02005.test.ts -To run the browser tests on whatever version of bun is running on port 3000: +import { it, expect } from "bun:test"; -```bash -make integration-test-dev +it("regex literal should work with non-latin1", () => { + const text = "这是一段要替换的文字"; + expect(text.replace(new RegExp("要替换"), "")).toBe("这是一段的文字"); + expect(text.replace(/要替换/, "")).toBe("这是一段的文字"); +}); ``` -These were the first tests bun started with - -#### Running the tests - -Run `bun wiptest ${part-of-file-name}` - -If you run the test in the top-level bun repo directory, it will take an extra couple seconds because `bun wiptest` will scan through all of WebKit recursively. Consider running it in the `bun.js` directory instead. - -### CLI tests +In the future, a bot will automatically close or re-open issues when a regression is detected or resolved. -These run the bash files in the `apps` directory. - -They check end-to-end that the CLI works as expected. - -```bash -# Install dependencies for running tests -# Does not run tests -make test-install - -# Check a Create React App created via `bun create react ./foo` returns HTML -make test-create-react - -# Check a Next.js app created via `bun create next ./foo` SSRs successfully -make test-create-next - -# Check that bun run works for the same CLI args passed to npm run -make test-bun-run - -# Check that "react" installed via bun install loads successfully -# and that deleting/adding updates the lockfile as expected -make test-bun-install - -# Check that serving public paths works correctly -# and that files which should be transpiled are transpiled and files which shouldn't be aren't -make test-bun-dev -``` - -### Zig tests +## Zig tests These tests live in various `.zig` files throughout Bun's codebase, leveraging Zig's builtin `test` keyword. -Currently, they're not run automatically nor is there a simple way to run all of them. - -This is an area bun needs to improve in. +Currently, they're not run automatically nor is there a simple way to run all of them. We will make this better soon. diff --git a/test/apps/bun-create-next.sh b/test/apps/bun-create-next.sh deleted file mode 100644 index d8e148282..000000000 --- a/test/apps/bun-create-next.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env bash - -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 "" - -rm -rf /tmp/next-app -mkdir -p /tmp/next-app -$BUN_BIN create next /tmp/next-app - -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 - -cd /tmp/next-app -BUN_CRASH_WITHOUT_JIT=1 $BUN_BIN dev --port 8087 & -sleep 0.1 -curl --fail -Ss http://localhost:8087/ - -if [[ "$(curl --fail -sS http://localhost:8087/file.txt)" != "hi!" ]]; then - echo "" - echo "" - echo "" - echo "ERR: Expected 'hi!', got '$(curl --fail -sS http://localhost:8087/file.txt)'" - killall -9 $(basename $BUN_BIN) || echo "" - exit 1 -fi - -if [[ "$(curl --fail -sS http://localhost:8087/file.js)" != *"string"* ]]; then - echo "" - echo "" - echo "" - echo "ERR: Expected file to contain string got '$(curl --fail -sS http://localhost:8087/file.js)'" - killall -9 $(basename $BUN_BIN) || echo "" - exit 1 -fi - -# very simple HMR test -echo "export default 'string';" >/tmp/next-app/file2.js -sleep 0.1 - -if [[ "$(curl --fail -sS http://localhost:8087/file2.js)" != *"string"* ]]; then - echo "" - echo "" - echo "" - echo "ERR: Expected file to contain string got '$(curl --fail -sS http://localhost:8087/file2.js)'" - killall -9 $(basename $BUN_BIN) || echo "" - exit 1 -fi - -killall -9 $(basename $BUN_BIN) || echo "" diff --git a/test/apps/bun-create-react.sh b/test/apps/bun-create-react.sh deleted file mode 100644 index 564a59d35..000000000 --- a/test/apps/bun-create-react.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -killall -9 $(basename $BUN_BIN) || echo "" - -rm -rf /tmp/react-app -mkdir -p /tmp/react-app -$BUN_BIN create react /tmp/react-app - - -if (($?)); then - echo "bun create failed" - exit 1 -fi - -cd /tmp/react-app -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." -exit $? diff --git a/test/apps/bun-dev-index-html.sh b/test/apps/bun-dev-index-html.sh deleted file mode 100644 index f22f8df51..000000000 --- a/test/apps/bun-dev-index-html.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -killall -9 $(basename $BUN_BIN) || echo "" - -dir=$(mktemp -d) - -index_content="<html><body>index.html</body></html>" -bacon_content="<html><body>bacon.html</body></html>" -js_content="if(0) { var foo = 'TEST FAILED'; }" -static_content="PASS" -css_not_transpiled_content="@import url(/index.js); @import url(/i-dont-exist.css); @import url('/i-dont-exist.css'); @import url(\"/i-dont-exist.css\");" -css_is_transpiled_import="*{background-color:red;}" -css_is_transpiled="@import url(./css_is_transpiled_import.css);" - -echo $index_content >"$dir/index.html" -echo $js_content >"$dir/index.js" -echo $bacon_content >"$dir/bacon.html" -echo $static_content >"$dir/static.txt" -echo $css_not_transpiled_content >"$dir/css_not_transpiled_content.css" - -cd $dir -$BUN_BIN dev --port 8087 & -sleep 0.005 - -if [[ "$(curl --fail -sS http://localhost:8087/)" != "$index_content" ]]; then - echo "ERR: Expected '$index_content', got '$(curl --fail -sS http://localhost:8087/)'" - exit 1 -fi - -if [[ "$(curl --fail -sS http://localhost:8087/index)" != "$index_content" ]]; then - echo "ERR: Expected '$index_content', got '$(curl --fail -sS http://localhost:8087/index)'" - exit 1 -fi - -if [[ "$(curl --fail -sS http://localhost:8087/static.txt)" != "PASS" ]]; then - echo "ERR: Expected static file, got '$(curl --fail -sS http://localhost:8087/static.txt)'" - exit 1 -fi - -# Check that the file is actually transpiled -if [[ "$(curl --fail -sS http://localhost:8087/index.js)" == *"TEST FAILED"* ]]; then - echo "ERR: Expected file to be transpiled, got '$(curl --fail -sS http://localhost:8087/index.js)'" - exit 1 -fi - -if [[ "$(curl --fail -sS http://localhost:8087/index.html)" != "$index_content" ]]; then - echo "ERR: Expected '$index_content', got '$(curl --fail -sS http://localhost:8087/index.html)'" - exit 1 -fi - -if [[ "$(curl --fail -sS http://localhost:8087/foo/foo)" != "$index_content" ]]; then - echo "ERR: Expected '$index_content', got '$(curl --fail -sS http://localhost:8087/index.html)'" - exit 1 -fi - -if [[ "$(curl --fail -sS http://localhost:8087/bacon)" != "$bacon_content" ]]; then - echo "ERR: Expected '$bacon_content', got '$(curl --fail -sS http://localhost:8087/bacon)'" - exit 1 -fi - -if [[ "$(curl --fail -sS http://localhost:8087/bacon.html)" != "$bacon_content" ]]; then - echo "ERR: Expected '$bacon_content', got '$(curl --fail -sS http://localhost:8087/bacon.html)'" - exit 1 -fi - -killall -9 $(basename $BUN_BIN) || echo "" -echo "✅ bun dev index html check passed." diff --git a/test/apps/bun-dev.sh b/test/apps/bun-dev.sh deleted file mode 100644 index ea15c1d21..000000000 --- a/test/apps/bun-dev.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -killall -9 $(basename $BUN_BIN) || echo "" - -dir=$(mktemp -d) - -index_content="<html><body>index.html</body></html>" -bacon_content="<html><body>bacon.html</body></html>" -js_content="console.log('hi')" - -mkdir -p $dir/public - -echo $index_content >"$dir/public/index.html" -echo $js_content >"$dir/index.js" -echo $bacon_content >"$dir/public/bacon.html" - -cd $dir - -$BUN_BIN dev --port 8087 & -sleep 0.005 - -if [ "$(curl --fail -sS http://localhost:8087/)" != "$index_content" ]; then - echo "ERR: Expected '$index_content', got '$(curl --fail -sS http://localhost:8087/)'" - exit 1 -fi - -if [ "$(curl --fail -sS http://localhost:8087/index)" != "$index_content" ]; then - echo "ERR: Expected '$index_content', got '$(curl --fail -sS http://localhost:8087/index)'" - exit 1 -fi - -if [ "$(curl --fail -sS http://localhost:8087/index.html)" != "$index_content" ]; then - echo "ERR: Expected '$index_content', got '$(curl --fail -sS http://localhost:8087/index.html)'" - exit 1 -fi - -if [ "$(curl --fail -sS http://localhost:8087/foo/foo)" != "$index_content" ]; then - echo "ERR: Expected '$index_content', got '$(curl --fail -sS http://localhost:8087/index.html)'" - exit 1 -fi - -if [ "$(curl --fail -sS http://localhost:8087/bacon)" != "$bacon_content" ]; then - echo "ERR: Expected '$index_content', got '$(curl --fail -sS http://localhost:8087/bacon)'" - exit 1 -fi - -if [ "$(curl --fail -sS http://localhost:8087/bacon.html)" != "$bacon_content" ]; then - echo "ERR: Expected '$index_content', got '$(curl --fail -sS http://localhost:8087/bacon.html)'" - exit 1 -fi - -killall -9 $(basename $BUN_BIN) || echo "" -echo "✅ bun dev index html check passed." diff --git a/test/apps/bun-init-check.sh b/test/apps/bun-init-check.sh deleted file mode 100644 index d0077cb60..000000000 --- a/test/apps/bun-init-check.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -# TODO: move this test to bun once we have a child_process equivalent. -(killall -9 $(basename $BUN_BIN) || echo "") >/dev/null 2>&1 - -rm -rf /tmp/bun-init-check -mkdir -p /tmp/bun-init-check - -cd /tmp/bun-init-check - -$BUN_BIN init -y - -if (($?)); then - echo "Bun init failed" - exit 1 -fi - -SHASUM_RESULT=$(cat index.ts .gitignore tsconfig.json package.json | shasum) - -# This test will fail when the minor version of Bun changes. -if [[ "${SHASUM_RESULT}" != "10eabf5101a3ef999bd67232a7af33542c525ec6 -" ]]; then - echo -e "Bun init shasum mismatch\n expected: b1548bb4e806f0506fd1b27ae8901d2e84926774\n actual: ${SHASUM_RESULT}" - exit 1 -fi - -exit 0 diff --git a/test/apps/bun-install-lockfile-status.sh b/test/apps/bun-install-lockfile-status.sh deleted file mode 100644 index fc39a6dd6..000000000 --- a/test/apps/bun-install-lockfile-status.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -killall -9 $(basename $BUN_BIN) || echo "" - -dir=$(mktemp -d) - -cd $dir - -$BUN_BIN add react - -echo "node_modules" >.gitignore - -git init && git add . && git commit -am "Initial commit" - -$BUN_BIN install - -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)'" - exit 1 -} - -$BUN_BIN add react - -NEW_LOCKFILE="$($BUN_BIN pm hash-string)" - -diff <(echo "$ORIG_LOCKFILE") <(echo "$NEW_LOCKFILE") || { - echo "ERR: Expected lockfile to be unchanged, got '$NEW_LOCKFILE'" - exit 1 -} - -ORIG_HASH=$($BUN_BIN bun.lockb --hash) - -$BUN_BIN remove react -$BUN_BIN add react - -NEW_HASH=$($BUN_BIN bun.lockb --hash) - -diff <(echo "$ORIG_HASH") <(echo "$NEW_HASH") || { - echo "ERR: Expected hash to be unchanged, got '$NEW_HASH'" - exit 1 -} - -echo '{ "dependencies": { "react": "17.0.2", "react-dom": "17.0.2" } }' >package.json - -$BUN_BIN install - -echo "var {version} = JSON.parse(require(\"fs\").readFileSync('./node_modules/react-dom/package.json', 'utf8')); if (version !== '17.0.2') {throw new Error('Unexpected react-dom version');}; " >index.js -$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 - -# 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 -} diff --git a/test/apps/bun-install-utf8.sh b/test/apps/bun-install-utf8.sh deleted file mode 100644 index ac6b684ed..000000000 --- a/test/apps/bun-install-utf8.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -killall -9 $(basename $BUN_BIN) || echo "" - -dir=$(mktemp -d) - -cd $dir - -# https://github.com/oven-sh/bun/issues/115 -echo '{ "author": "Arnaud Barré (https://github.com/ArnaudBarre)" }' >package.json - -$BUN_BIN add react diff --git a/test/apps/bun-install.sh b/test/apps/bun-install.sh deleted file mode 100644 index 18813b2d2..000000000 --- a/test/apps/bun-install.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -dir=$(mktemp -d) - -cd $dir -${NPM_CLIENT:-$(which bun)} add react react-dom @types/react @babel/parser esbuild vite@3.0.0 - -echo "console.log(typeof require(\"react\").createElement);" >index.js -chmod +x index.js - -JS_RUNTIME=${JS_RUNTIME:-"$(which bun)"} - -if [ "$JS_RUNTIME" == "node" ]; then - result="$(node ./index.js)" -fi - -if [ "$JS_RUNTIME" != "node" ]; then - result="$($JS_RUNTIME run ./index.js)" -fi - -echo "console.log(typeof require(\"react-dom\").render);" >index.js -chmod +x index.js - -JS_RUNTIME=${JS_RUNTIME:-"$(which bun)"} - -# If this fails to run, it means we didn't link @babel/parser correctly -$(which grealpath || which realpath) -e ./node_modules/.bin/parser >/dev/null - -# If this fails to run, it means we didn't link esbuild correctly or esbuild's install script broke -# - https://github.com/evanw/esbuild/issues/2558 -./node_modules/.bin/esbuild --version >/dev/null - -VITE_ESBUILD="$(echo node_modules/vite/node_modules/esbuild-*)" -$VITE_ESBUILD/bin/esbuild --version >/dev/null - -if [ "$JS_RUNTIME" == "node" ]; then - result="$(node ./index.js)" -fi - -if [ "$JS_RUNTIME" != "node" ]; then - result="$($JS_RUNTIME run ./index.js)" -fi - -if [ "$result" != "function" ]; then - echo "ERR: Expected 'function', got '$result'" - exit 1 -fi - -${NPM_CLIENT:-$(which bun)} remove react-dom - -if [ -d "node_modules/react-dom" ]; then - echo "ERR: react-dom module still exists in $dir" - exit 1 -fi - -yarn_dot_lock=$(${NPM_CLIENT:-$(which bun)} bun.lockb) - -if echo "$yarn_dot_lock" | grep -q "react-dom"; then - echo "ERR: react-dom module still exists in lockfile" - exit 1 -fi - -${NPM_CLIENT:-$(which bun)} remove @types/react - -yarn_dot_lock=$(${NPM_CLIENT:-$(which bun)} bun.lockb) - -if echo "$yarn_dot_lock" | grep -q "@types/react"; then - echo "ERR: @types/react module still exists in lockfile" - exit 1 -fi - -if echo "$yarn_dot_lock" | grep -q "@types/react"; then - echo "ERR: @types/react module still exists in $dir" - exit 1 -fi - -${NPM_CLIENT:-$(which bun)} remove react - -if [ -d "node_modules/react" ]; then - echo "ERR: react module still exists in $dir" - exit 1 -fi - -if [ -d "bun.lockb" ]; then - echo "ERR: empty bun.lockb should be deleted" - exit 1 -fi diff --git a/test/apps/bun-run-check-nameless-package.json b/test/apps/bun-run-check-nameless-package.json deleted file mode 100644 index 8ace03613..000000000 --- a/test/apps/bun-run-check-nameless-package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "scripts": { - "this-should-work": "echo \"✅ bun run test passed!\"", - "argv": "node -e 'console.log(process.argv)'" - } -} diff --git a/test/apps/bun-run-check-package.json b/test/apps/bun-run-check-package.json deleted file mode 100644 index b6eeda046..000000000 --- a/test/apps/bun-run-check-package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "check", - "scripts": { - "this-should-work": "echo \"✅ bun run test passed!\"", - "argv": "node -e 'console.log(process.argv)'" - } -} diff --git a/test/apps/bun-run-check.sh b/test/apps/bun-run-check.sh deleted file mode 100644 index 25432c422..000000000 --- a/test/apps/bun-run-check.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash - -# TODO: move this test to bun once we have a child_process equivalent. -(killall -9 $(basename $BUN_BIN) || echo "") >/dev/null 2>&1 - -# https://github.com/oven-sh/bun/issues/40 -# Define a function (details aren't important) -fn() { :; } -# The important bit: export the function -export -f fn - -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_BIN run bash -- -c "" - -if (($?)); then - echo "Bash exported functions are broken" - exit 1 -fi - -# We need to run these tests for two variations: -# bun run foo "bar" -# bun run foo -- "bar" -# the "--" should be ignored -# in earlier versions of bun, it was required to be present - -$BUN_BIN run bash -c "" -if (($?)); then - echo "Bash exported functions are broken" - exit 1 -fi - -# https://github.com/oven-sh/bun/issues/53 -rm -f /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt >/dev/null 2>&1 - -$BUN_BIN run --silent argv -- foo bar baz >/tmp/bun-run-out.txt -npm run --silent argv -- foo bar baz >/tmp/bun-run-out.expected.txt - -cmp -s /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt -if (($?)); then - echo "argv failed" - exit 1 -fi - -rm -f /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt >/dev/null 2>&1 - -$BUN_BIN run --silent argv foo bar baz >/tmp/bun-run-out.txt -npm run --silent argv -- foo bar baz >/tmp/bun-run-out.expected.txt - -cmp -s /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt -if (($?)); then - echo "argv failed" - exit 1 -fi - -$BUN_BIN run --silent this-should-work - -if (($?)); then - echo "this-should work failed" - exit 1 -fi - -exit 0 diff --git a/test/bun.js/.prettierignore b/test/bun.js/.prettierignore deleted file mode 100644 index 91b589eb2..000000000 --- a/test/bun.js/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -third-party diff --git a/test/bun.js/bun.lockb b/test/bun.js/bun.lockb Binary files differdeleted file mode 100755 index 0c6a33d3d..000000000 --- a/test/bun.js/bun.lockb +++ /dev/null diff --git a/test/bun.js/bunEnv.ts b/test/bun.js/bunEnv.ts deleted file mode 100644 index 2fe33a4ea..000000000 --- a/test/bun.js/bunEnv.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const bunEnv: any = { - ...process.env, - BUN_DEBUG_QUIET_LOGS: "1", - NO_COLOR: "1", - FORCE_COLOR: undefined, -}; diff --git a/test/bun.js/bunExe.ts b/test/bun.js/bunExe.ts deleted file mode 100644 index a66f702de..000000000 --- a/test/bun.js/bunExe.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function bunExe() { - return process.execPath; -} diff --git a/test/bun.js/bundled/always-bundled-module/always-bundled-module b/test/bun.js/bundled/always-bundled-module/always-bundled-module deleted file mode 120000 index f9a91ac4d..000000000 --- a/test/bun.js/bundled/always-bundled-module/always-bundled-module +++ /dev/null @@ -1 +0,0 @@ -node_modules/always-bundled-module
\ No newline at end of file diff --git a/test/bun.js/bundled/always-bundled-module/cjs.js b/test/bun.js/bundled/always-bundled-module/cjs.js deleted file mode 100644 index 087697589..000000000 --- a/test/bun.js/bundled/always-bundled-module/cjs.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - default: 0xdeadbeef, - default() { - return "ok"; - }, - default: true, - ok() { - return true; - }, -}; diff --git a/test/bun.js/bundled/always-bundled-module/esm.js b/test/bun.js/bundled/always-bundled-module/esm.js deleted file mode 100644 index 28e702881..000000000 --- a/test/bun.js/bundled/always-bundled-module/esm.js +++ /dev/null @@ -1,5 +0,0 @@ -const __esModule = true; - -export const foo = () => __esModule; - -export { __esModule, foo as default }; diff --git a/test/bun.js/bundled/always-bundled-module/package.json b/test/bun.js/bundled/always-bundled-module/package.json deleted file mode 100644 index 5029c1695..000000000 --- a/test/bun.js/bundled/always-bundled-module/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "always-bundled-module", - "version": "1.0.0" -} diff --git a/test/bun.js/bundled/entrypoint.ts b/test/bun.js/bundled/entrypoint.ts deleted file mode 100644 index b9a17b538..000000000 --- a/test/bun.js/bundled/entrypoint.ts +++ /dev/null @@ -1,13 +0,0 @@ -import "i-am-bundled/cjs"; -import "i-am-bundled/esm"; -import "always-bundled-module/esm"; -import "always-bundled-module/cjs"; -import { foo } from "i-am-bundled/esm"; -import { foo as foo2 } from "always-bundled-module/esm"; -import cJS from "always-bundled-module/cjs"; - -foo(); -foo2(); -cJS(); - -export default cJS(); diff --git a/test/bun.js/bundled/package.json b/test/bun.js/bundled/package.json deleted file mode 100644 index cce72af9c..000000000 --- a/test/bun.js/bundled/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "to-bundle", - "scripts": { - "prebundle": "rm -rf node_modules; cp -r to_bundle_node_modules node_modules; ln -s always-bundled-module node_modules/always-bundled-module", - "bundle": "${BUN_BIN:-$(which bun)} bun ./entrypoint.ts" - }, - "bun": { - "alwaysBundle": [ - "always-bundled-module" - ] - } -} diff --git a/test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/cjs.js b/test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/cjs.js deleted file mode 100644 index 087697589..000000000 --- a/test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/cjs.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - default: 0xdeadbeef, - default() { - return "ok"; - }, - default: true, - ok() { - return true; - }, -}; diff --git a/test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/esm.js b/test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/esm.js deleted file mode 100644 index 28e702881..000000000 --- a/test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/esm.js +++ /dev/null @@ -1,5 +0,0 @@ -const __esModule = true; - -export const foo = () => __esModule; - -export { __esModule, foo as default }; diff --git a/test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/package.json b/test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/package.json deleted file mode 100644 index 661a80b2d..000000000 --- a/test/bun.js/bundled/to_bundle_node_modules/i-am-bundled/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "i-am-bundled", - "version": "1.0.0" -} diff --git a/test/bun.js/bundled/tsconfig.json b/test/bun.js/bundled/tsconfig.json deleted file mode 100644 index 3ccb11ae4..000000000 --- a/test/bun.js/bundled/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "paths": {}, - "baseUrl": ".", - } -}
\ No newline at end of file diff --git a/test/bun.js/file-importing-nonexistent-file.js b/test/bun.js/file-importing-nonexistent-file.js deleted file mode 100644 index 1136a7d8c..000000000 --- a/test/bun.js/file-importing-nonexistent-file.js +++ /dev/null @@ -1 +0,0 @@ -import "./does-not-exist.js"; diff --git a/test/bun.js/google-fixture.html b/test/bun.js/google-fixture.html deleted file mode 100644 index a5042789e..000000000 --- a/test/bun.js/google-fixture.html +++ /dev/null @@ -1,632 +0,0 @@ -<!DOCTYPE html> -<html itemscope="" itemtype="http://schema.org/WebPage" lang="en"> - <head> - <meta - content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for." - name="description" - /> - <meta content="noodp" name="robots" /> - <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> - <meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image" /> - <title>Google</title> - <script nonce="GkiuApJ39JY6FCXsWXwc0g"> - (function () { - window.google = { - kEI: "8kuEY6zVJKHhkPIPl6yFkAs", - kEXPI: - "0,1359409,6059,206,2414,2390,2316,383,246,5,5367,1123753,1197711,380780,16114,28684,22430,1362,12316,2818,14765,4998,13228,3847,10622,22741,5081,1593,1279,2742,149,1103,840,1983,4314,3514,606,2023,2297,14670,3227,2847,6,33769,1850,15325,432,3,346,1244,1,5445,148,11323,2652,4,1528,2304,7039,22023,5708,7355,11444,2216,2980,1457,15351,1435,5815,2542,4094,4052,3,3541,1,27183,14971,2,14022,2373,342,23024,5679,1020,2381,12485,16256,4568,6256,23421,1252,5835,14968,4332,2204,5280,445,2,2,1,10956,6356,9320,8155,7381,2,3,1475,14490,873,6577,3048,10008,9,1352,568,5784,3995,20640,1139,14375,15759,10745,8880,11256,14,82,950,2940,751,2070,641,7153,2009,2271,735,3,683,109,112,718,683,899,879,1856,1996,1119,6,1539,42,2204,1053,3401,670,79,244,458,5201,1742,813,1224,10,2626,84,600,817,2,563,402,337,252,64,933,394,151,553,171,96,83,90,554,368,450,473,110,36,6,291,1092,2300,443,483,402,407,481,120,20,3,784,3,80,2261,283,141,57,651,7,2,3,67,761,274,246,64,34,334,1,57,727,57,1275,13,90,890,57,1,856,301,262,665,91,8,13,114,310,34,1436,55,149,66,168,42,29,3,253,246,1214,461,771,92,1345,174,198,96,969,67,2,560,278,497,672,264,196,19,248,359,262,5,363,78,365,3,147,613,522,180,332,209,21,17,102,830,36,42,1,403,1265,313,2,389,326,9,81,1288,11289133,2803332,3311,141,795,19735,1,1,346,1903,856,41,169,1,23947515,486,25,19,15,4041597,1964,3094,13579,3405,5595,11,5758,1469,1135,14,1029", - kBL: "-1VY", - }; - google.sn = "webhp"; - google.kHL = "en"; - })(); - (function () { - var f = this || self; - var h, - k = []; - function l(a) { - for (var b; a && (!a.getAttribute || !(b = a.getAttribute("eid"))); ) a = a.parentNode; - return b || h; - } - function m(a) { - for (var b = null; a && (!a.getAttribute || !(b = a.getAttribute("leid"))); ) a = a.parentNode; - return b; - } - function n(a, b, c, d, g) { - var e = ""; - c || - -1 !== b.search("&ei=") || - ((e = "&ei=" + l(d)), -1 === b.search("&lei=") && (d = m(d)) && (e += "&lei=" + d)); - d = ""; - !c && f._cshid && -1 === b.search("&cshid=") && "slh" !== a && (d = "&cshid=" + f._cshid); - c = c || "/" + (g || "gen_204") + "?atyp=i&ct=" + a + "&cad=" + b + e + "&zx=" + Date.now() + d; - /^http:/i.test(c) && - "https:" === window.location.protocol && - (google.ml && google.ml(Error("a"), !1, { src: c, glmm: 1 }), (c = "")); - return c; - } - h = google.kEI; - google.getEI = l; - google.getLEI = m; - google.ml = function () { - return null; - }; - google.log = function (a, b, c, d, g) { - if ((c = n(a, b, c, d, g))) { - a = new Image(); - var e = k.length; - k[e] = a; - a.onerror = - a.onload = - a.onabort = - function () { - delete k[e]; - }; - a.src = c; - } - }; - google.logUrl = n; - }).call(this); - (function () { - google.y = {}; - google.sy = []; - google.x = function (a, b) { - if (a) var c = a.id; - else { - do c = Math.random(); - while (google.y[c]); - } - google.y[c] = [a, b]; - return !1; - }; - google.sx = function (a) { - google.sy.push(a); - }; - google.lm = []; - google.plm = function (a) { - google.lm.push.apply(google.lm, a); - }; - google.lq = []; - google.load = function (a, b, c) { - google.lq.push([[a], b, c]); - }; - google.loadAll = function (a, b) { - google.lq.push([a, b]); - }; - google.bx = !1; - google.lx = function () {}; - }).call(this); - google.f = {}; - (function () { - document.documentElement.addEventListener( - "submit", - function (b) { - var a; - if ((a = b.target)) { - var c = a.getAttribute("data-submitfalse"); - a = "1" === c || ("q" === c && !a.elements.q.value) ? !0 : !1; - } else a = !1; - a && (b.preventDefault(), b.stopPropagation()); - }, - !0, - ); - document.documentElement.addEventListener( - "click", - function (b) { - var a; - a: { - for (a = b.target; a && a !== document.documentElement; a = a.parentElement) - if ("A" === a.tagName) { - a = "1" === a.getAttribute("data-nohref"); - break a; - } - a = !1; - } - a && b.preventDefault(); - }, - !0, - ); - }).call(this); - </script> - <style> - #gbar, - #guser { - font-size: 13px; - padding-top: 1px !important; - } - #gbar { - height: 22px; - } - #guser { - padding-bottom: 7px !important; - text-align: right; - } - .gbh, - .gbd { - border-top: 1px solid #c9d7f1; - font-size: 1px; - } - .gbh { - height: 0; - position: absolute; - top: 24px; - width: 100%; - } - @media all { - .gb1 { - height: 22px; - margin-right: 0.5em; - vertical-align: top; - } - #gbar { - float: left; - } - } - a.gb1, - a.gb4 { - text-decoration: underline !important; - } - a.gb1, - a.gb4 { - color: #00c !important; - } - .gbi .gb4 { - color: #dd8e27 !important; - } - .gbf .gb4 { - color: #900 !important; - } - </style> - <style> - body, - td, - a, - p, - .h { - font-family: arial, sans-serif; - } - body { - margin: 0; - overflow-y: scroll; - } - #gog { - padding: 3px 8px 0; - } - td { - line-height: 0.8em; - } - .gac_m td { - line-height: 17px; - } - form { - margin-bottom: 20px; - } - .h { - color: #1558d6; - } - em { - font-weight: bold; - font-style: normal; - } - .lst { - height: 25px; - width: 496px; - } - .gsfi, - .lst { - font: 18px arial, sans-serif; - } - .gsfs { - font: 17px arial, sans-serif; - } - .ds { - display: inline-box; - display: inline-block; - margin: 3px 0 4px; - margin-left: 4px; - } - input { - font-family: inherit; - } - body { - background: #fff; - color: #000; - } - a { - color: #4b11a8; - text-decoration: none; - } - a:hover, - a:active { - text-decoration: underline; - } - .fl a { - color: #1558d6; - } - a:visited { - color: #4b11a8; - } - .sblc { - padding-top: 5px; - } - .sblc a { - display: block; - margin: 2px 0; - margin-left: 13px; - font-size: 11px; - } - .lsbb { - background: #f8f9fa; - border: solid 1px; - border-color: #dadce0 #70757a #70757a #dadce0; - height: 30px; - } - .lsbb { - display: block; - } - #WqQANb a { - display: inline-block; - margin: 0 12px; - } - .lsb { - background: url(/images/nav_logo229.png) 0 -261px repeat-x; - border: none; - color: #000; - cursor: pointer; - height: 30px; - margin: 0; - outline: 0; - font: 15px arial, sans-serif; - vertical-align: top; - } - .lsb:active { - background: #dadce0; - } - .lst:focus { - outline: none; - } - </style> - <script nonce="GkiuApJ39JY6FCXsWXwc0g"> - (function () { - window.google.erd = { jsr: 1, bv: 1693, de: true }; - var h = this || self; - var k, - l = null != (k = h.mei) ? k : 1, - n, - p = null != (n = h.sdo) ? n : !0, - q = 0, - r, - t = google.erd, - v = t.jsr; - google.ml = function (a, b, d, m, e) { - e = void 0 === e ? 2 : e; - b && (r = a && a.message); - if (google.dl) return google.dl(a, e, d), null; - if (0 > v) { - window.console && console.error(a, d); - if (-2 === v) throw a; - b = !1; - } else b = !a || !a.message || "Error loading script" === a.message || (q >= l && !m) ? !1 : !0; - if (!b) return null; - q++; - d = d || {}; - b = encodeURIComponent; - var c = "/gen_204?atyp=i&ei=" + b(google.kEI); - google.kEXPI && (c += "&jexpid=" + b(google.kEXPI)); - c += "&srcpg=" + b(google.sn) + "&jsr=" + b(t.jsr) + "&bver=" + b(t.bv); - var f = a.lineNumber; - void 0 !== f && (c += "&line=" + f); - var g = a.fileName; - g && - (0 < g.indexOf("-extension:/") && (e = 3), - (c += "&script=" + b(g)), - f && - g === window.location.href && - ((f = document.documentElement.outerHTML.split("\n")[f]), - (c += "&cad=" + b(f ? f.substring(0, 300) : "No script found.")))); - c += "&jsel=" + e; - for (var u in d) (c += "&"), (c += b(u)), (c += "="), (c += b(d[u])); - c = c + "&emsg=" + b(a.name + ": " + a.message); - c = c + "&jsst=" + b(a.stack || "N/A"); - 12288 <= c.length && (c = c.substr(0, 12288)); - a = c; - m || google.log(0, "", a); - return a; - }; - window.onerror = function (a, b, d, m, e) { - r !== a && - ((a = e instanceof Error ? e : Error(a)), - void 0 === d || "lineNumber" in a || (a.lineNumber = d), - void 0 === b || "fileName" in a || (a.fileName = b), - google.ml( - a, - !1, - void 0, - !1, - "SyntaxError" === a.name || - "SyntaxError" === a.message.substring(0, 11) || - -1 !== a.message.indexOf("Script error") - ? 3 - : 0, - )); - r = null; - p && q >= l && (window.onerror = null); - }; - })(); - </script> - </head> - <body bgcolor="#fff"> - <script nonce="GkiuApJ39JY6FCXsWXwc0g"> - (function () { - var src = "/images/nav_logo229.png"; - var iesg = false; - document.body.onload = function () { - window.n && window.n(); - if (document.images) { - new Image().src = src; - } - if (!iesg) { - document.f && document.f.q.focus(); - document.gbqf && document.gbqf.q.focus(); - } - }; - })(); - </script> - <div id="mngb"> - <div id="gbar"> - <nobr - ><b class="gb1">Search</b> <a class="gb1" href="https://www.google.com/imghp?hl=en&tab=wi">Images</a> - <a class="gb1" href="https://maps.google.com/maps?hl=en&tab=wl">Maps</a> - <a class="gb1" href="https://play.google.com/?hl=en&tab=w8">Play</a> - <a class="gb1" href="https://www.youtube.com/?tab=w1">YouTube</a> - <a class="gb1" href="https://news.google.com/?tab=wn">News</a> - <a class="gb1" href="https://mail.google.com/mail/?tab=wm">Gmail</a> - <a class="gb1" href="https://drive.google.com/?tab=wo">Drive</a> - <a class="gb1" style="text-decoration: none" href="https://www.google.com/intl/en/about/products?tab=wh" - ><u>More</u> »</a - ></nobr - > - </div> - <div id="guser" width="100%"> - <nobr - ><span id="gbn" class="gbi"></span><span id="gbf" class="gbf"></span><span id="gbe"></span - ><a href="http://www.google.com/history/optout?hl=en" class="gb4">Web History</a> | - <a href="/preferences?hl=en" class="gb4">Settings</a> | - <a - target="_top" - id="gb_70" - href="https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/&ec=GAZAAQ" - class="gb4" - >Sign in</a - ></nobr - > - </div> - <div class="gbh" style="left: 0"></div> - <div class="gbh" style="right: 0"></div> - </div> - <center> - <br clear="all" id="lgpd" /> - <div id="lga"> - <img - alt="Google" - height="92" - src="/images/branding/googlelogo/1x/googlelogo_white_background_color_272x92dp.png" - style="padding: 28px 0 14px" - width="272" - id="hplogo" - /><br /><br /> - </div> - <form action="/search" name="f"> - <table cellpadding="0" cellspacing="0"> - <tr valign="top"> - <td width="25%"> </td> - <td align="center" nowrap=""> - <input name="ie" value="ISO-8859-1" type="hidden" /><input value="en" name="hl" type="hidden" /><input - name="source" - type="hidden" - value="hp" - /><input name="biw" type="hidden" /><input name="bih" type="hidden" /> - <div class="ds" style="height: 32px; margin: 4px 0"> - <input - class="lst" - style="margin: 0; padding: 5px 8px 0 6px; vertical-align: top; color: #000" - autocomplete="off" - value="" - title="Google Search" - maxlength="2048" - name="q" - size="57" - /> - </div> - <br style="line-height: 0" /><span class="ds" - ><span class="lsbb"><input class="lsb" value="Google Search" name="btnG" type="submit" /></span></span - ><span class="ds" - ><span class="lsbb" - ><input class="lsb" id="tsuid_1" value="I'm Feeling Lucky" name="btnI" type="submit" /> - <script nonce="GkiuApJ39JY6FCXsWXwc0g"> - (function () { - var id = "tsuid_1"; - document.getElementById(id).onclick = function () { - if (this.form.q.value) { - this.checked = 1; - if (this.form.iflsig) this.form.iflsig.disabled = false; - } else top.location = "/doodles/"; - }; - })(); - </script> - <input value="AJiK0e8AAAAAY4RaAr_DYhOW5v1e7hnMw1PppyhHzD0h" name="iflsig" type="hidden" /></span - ></span> - </td> - <td class="fl sblc" align="left" nowrap="" width="25%"> - <a href="/advanced_search?hl=en&authuser=0">Advanced search</a> - </td> - </tr> - </table> - <input id="gbv" name="gbv" type="hidden" value="1" /> - <script nonce="GkiuApJ39JY6FCXsWXwc0g"> - (function () { - var a, - b = "1"; - if (document && document.getElementById) - if ("undefined" != typeof XMLHttpRequest) b = "2"; - else if ("undefined" != typeof ActiveXObject) { - var c, - d, - e = ["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]; - for (c = 0; (d = e[c++]); ) - try { - new ActiveXObject(d), (b = "2"); - } catch (h) {} - } - a = b; - if ("2" == a && -1 == location.search.indexOf("&gbv=2")) { - var f = google.gbvu, - g = document.getElementById("gbv"); - g && (g.value = a); - f && - window.setTimeout(function () { - location.href = f; - }, 0); - } - }).call(this); - </script> - </form> - <div id="gac_scont"></div> - <div style="font-size: 83%; min-height: 3.5em"><br /></div> - <span id="footer" - ><div style="font-size: 10pt"> - <div style="margin: 19px auto; text-align: center" id="WqQANb"> - <a href="/intl/en/ads/">Advertising†Programs</a><a href="/services/">Business Solutions</a - ><a href="/intl/en/about.html">About Google</a> - </div> - </div> - <p style="font-size: 8pt; color: #70757a"> - © 2022 - <a href="/intl/en/policies/privacy/">Privacy</a> - <a href="/intl/en/policies/terms/">Terms</a> - </p></span - > - </center> - <script nonce="GkiuApJ39JY6FCXsWXwc0g"> - (function () { - window.google.cdo = { height: 757, width: 1440 }; - (function () { - var a = window.innerWidth, - b = window.innerHeight; - if (!a || !b) { - var c = window.document, - d = "CSS1Compat" == c.compatMode ? c.documentElement : c.body; - a = d.clientWidth; - b = d.clientHeight; - } - a && - b && - (a != google.cdo.width || b != google.cdo.height) && - google.log("", "", "/client_204?&atyp=i&biw=" + a + "&bih=" + b + "&ei=" + google.kEI); - }).call(this); - })(); - </script> - <script nonce="GkiuApJ39JY6FCXsWXwc0g"> - (function () { - google.xjs = { ck: "xjs.hp.o5AfvK7BgaM.L.X.O", cs: "ACT90oHyGC850G6IwjNxf19ZOa0R6EWAQw", excm: [] }; - })(); - </script> - <script nonce="GkiuApJ39JY6FCXsWXwc0g"> - (function () { - var u = - "/xjs/_/js/k\x3dxjs.hp.en_US.dE-FG74hDaY.O/am\x3dAADoBABQAGAB/d\x3d1/ed\x3d1/rs\x3dACT90oFXGhsDPcVbgIE3ddPch07JJa-91Q/m\x3dsb_he,d"; - var amd = 0; - var d = this || self, - e = function (a) { - return a; - }; - var g; - var l = function (a, b) { - this.g = b === h ? a : ""; - }; - l.prototype.toString = function () { - return this.g + ""; - }; - var h = {}; - function m() { - var a = u; - google.lx = function () { - p(a); - google.lx = function () {}; - }; - google.bx || google.lx(); - } - function p(a) { - google.timers && google.timers.load && google.tick && google.tick("load", "xjsls"); - var b = document; - var c = "SCRIPT"; - "application/xhtml+xml" === b.contentType && (c = c.toLowerCase()); - c = b.createElement(c); - if (void 0 === g) { - b = null; - var k = d.trustedTypes; - if (k && k.createPolicy) { - try { - b = k.createPolicy("goog#html", { createHTML: e, createScript: e, createScriptURL: e }); - } catch (q) { - d.console && d.console.error(q.message); - } - g = b; - } else g = b; - } - a = (b = g) ? b.createScriptURL(a) : a; - a = new l(a, h); - c.src = a instanceof l && a.constructor === l ? a.g : "type_error:TrustedResourceUrl"; - var f, n; - (f = (a = - null == (n = (f = ((c.ownerDocument && c.ownerDocument.defaultView) || window).document).querySelector) - ? void 0 - : n.call(f, "script[nonce]")) - ? a.nonce || a.getAttribute("nonce") || "" - : "") && c.setAttribute("nonce", f); - document.body.appendChild(c); - google.psa = !0; - } - google.xjsu = u; - setTimeout(function () { - 0 < amd - ? google.caft(function () { - return m(); - }, amd) - : m(); - }, 0); - })(); - function _DumpException(e) { - throw e; - } - function _F_installCss(c) {} - (function () { - google.jl = { - blt: "none", - chnk: 0, - dw: false, - dwu: true, - emtn: 0, - end: 0, - ico: false, - ikb: 0, - ine: false, - injs: "none", - injt: 0, - injth: 0, - injv2: false, - lls: "default", - pdt: 0, - rep: 0, - snet: true, - strt: 0, - ubm: false, - uwp: true, - }; - })(); - (function () { - var pmc = - "{\x22d\x22:{},\x22sb_he\x22:{\x22agen\x22:true,\x22cgen\x22:true,\x22client\x22:\x22heirloom-hp\x22,\x22dh\x22:true,\x22ds\x22:\x22\x22,\x22fl\x22:true,\x22host\x22:\x22google.com\x22,\x22jsonp\x22:true,\x22msgs\x22:{\x22cibl\x22:\x22Clear Search\x22,\x22dym\x22:\x22Did you mean:\x22,\x22lcky\x22:\x22I\\u0026#39;m Feeling Lucky\x22,\x22lml\x22:\x22Learn more\x22,\x22psrc\x22:\x22This search was removed from your \\u003Ca href\x3d\\\x22/history\\\x22\\u003EWeb History\\u003C/a\\u003E\x22,\x22psrl\x22:\x22Remove\x22,\x22sbit\x22:\x22Search by image\x22,\x22srch\x22:\x22Google Search\x22},\x22ovr\x22:{},\x22pq\x22:\x22\x22,\x22rfs\x22:[],\x22sbas\x22:\x220 3px 8px 0 rgba(0,0,0,0.2),0 0 0 1px rgba(0,0,0,0.08)\x22,\x22stok\x22:\x22sL4-RrhdjZ3aIiP5pD7muEeZ3T8\x22}}"; - google.pmc = JSON.parse(pmc); - })(); - </script> - </body> -</html> diff --git a/test/bun.js/import.live.rexport.js b/test/bun.js/import.live.rexport.js deleted file mode 100644 index e4accd2ba..000000000 --- a/test/bun.js/import.live.rexport.js +++ /dev/null @@ -1,2 +0,0 @@ -export { foo, setFoo } from "./import.live.decl"; -import { foo as bar } from "./import.live.decl"; diff --git a/test/bun.js/module-require.snapshot.js b/test/bun.js/module-require.snapshot.js deleted file mode 100644 index d0270bb4c..000000000 --- a/test/bun.js/module-require.snapshot.js +++ /dev/null @@ -1 +0,0 @@ -console.log(module.require("react")); diff --git a/test/bun.js/package.json b/test/bun.js/package.json deleted file mode 100644 index 709dc6602..000000000 --- a/test/bun.js/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "bun-tests", - "dependencies": { - "esbuild": "0.15.13", - "uuid": "^9.0.0", - "tiny-typed-emitter": "^1.0.0", - "svelte": "^3.52.0" - }, - "prettier": "../../.prettierrc.cjs" -} diff --git a/test/bun.js/readdir.js b/test/bun.js/readdir.js deleted file mode 100644 index 18c111d0a..000000000 --- a/test/bun.js/readdir.js +++ /dev/null @@ -1,9 +0,0 @@ -const { readdirSync } = require("fs"); - -const count = parseInt(process.env.ITERATIONS || "1", 10) || 1; - -for (let i = 0; i < count; i++) { - readdirSync("."); -} - -console.log(readdirSync(".")); diff --git a/test/bun.js/snapshots.debug.js b/test/bun.js/snapshots.debug.js deleted file mode 100644 index cb774b382..000000000 --- a/test/bun.js/snapshots.debug.js +++ /dev/null @@ -1,7 +0,0 @@ -// test/bun.js/module-require.snapshot.js -import { __require as require } from "bun:wrap"; -console.log(import.meta.require("/Users/jarred/Code/bun/node_modules/react/index.js")); - -// test/bun.js/require-referenceerror.snapshot.js - -// test/bun.js/tiny-typed-emitter.snapshot.js diff --git a/test/bun.js/snapshots.js b/test/bun.js/snapshots.js deleted file mode 100644 index cb774b382..000000000 --- a/test/bun.js/snapshots.js +++ /dev/null @@ -1,7 +0,0 @@ -// test/bun.js/module-require.snapshot.js -import { __require as require } from "bun:wrap"; -console.log(import.meta.require("/Users/jarred/Code/bun/node_modules/react/index.js")); - -// test/bun.js/require-referenceerror.snapshot.js - -// test/bun.js/tiny-typed-emitter.snapshot.js diff --git a/test/bun.js/some-fs.js b/test/bun.js/some-fs.js deleted file mode 100644 index c162ed45a..000000000 --- a/test/bun.js/some-fs.js +++ /dev/null @@ -1,45 +0,0 @@ -const { mkdirSync, existsSync } = require("fs"); - -var performance = globalThis.performance; -if (!performance) { - try { - performance = require("perf_hooks").performance; - } catch (e) {} -} - -const count = parseInt(process.env.ITERATIONS || "1", 10) || 1; -var tempdir = `/tmp/some-fs-test/dir/${Date.now()}/hi`; - -for (let i = 0; i < count; i++) { - tempdir += `/${i.toString(36)}`; -} - -if (existsSync(tempdir)) { - throw new Error(`existsSync reports ${tempdir} exists, but it probably does not`); -} - -var origTempDir = tempdir; -var iterations = new Array(count * count).fill(""); -var total = 0; -for (let i = 0; i < count; i++) { - for (let j = 0; j < count; j++) { - iterations[total++] = `${origTempDir}/${j.toString(36)}-${i.toString(36)}`; - } -} -tempdir = origTempDir; -mkdirSync(origTempDir, { recursive: true }); -const recurse = { recursive: false }; -const start = performance.now(); -for (let i = 0; i < total; i++) { - mkdirSync(iterations[i], recurse); -} - -console.log("MKDIR " + total + " depth took:", performance.now() - start, "ms"); - -if (!existsSync(tempdir)) { - throw new Error("Expected directory to exist after mkdirSync, but it doesn't"); -} - -if (mkdirSync(tempdir, { recursive: true })) { - throw new Error("mkdirSync shouldn't return directory name on existing directories"); -} diff --git a/test/bun.js/test-programs/bigpipe-r.c b/test/bun.js/test-programs/bigpipe-r.c deleted file mode 100644 index 1acd94f7b..000000000 --- a/test/bun.js/test-programs/bigpipe-r.c +++ /dev/null @@ -1,26 +0,0 @@ -#include <unistd.h> - -char one_mb_pipe_buf_1[1024 * 1024]; - - int main(int argc, char* argv[]) - { - for (int i = 0; i < sizeof(one_mb_pipe_buf_1); i++) { - one_mb_pipe_buf_1[i] = i % 256; - } - - while (1) { - - - size_t amt = 0; - size_t cnt = 0; - - cnt = 0; - while (cnt < sizeof(one_mb_pipe_buf_1)) { - amt = read(0, one_mb_pipe_buf_1 + cnt, sizeof(one_mb_pipe_buf_1) - cnt); - if (amt == 0) { - break; - } - cnt += amt; - } - } - }
\ No newline at end of file diff --git a/test/bun.js/test-programs/bigpipe-w.c b/test/bun.js/test-programs/bigpipe-w.c deleted file mode 100644 index 1acd94f7b..000000000 --- a/test/bun.js/test-programs/bigpipe-w.c +++ /dev/null @@ -1,26 +0,0 @@ -#include <unistd.h> - -char one_mb_pipe_buf_1[1024 * 1024]; - - int main(int argc, char* argv[]) - { - for (int i = 0; i < sizeof(one_mb_pipe_buf_1); i++) { - one_mb_pipe_buf_1[i] = i % 256; - } - - while (1) { - - - size_t amt = 0; - size_t cnt = 0; - - cnt = 0; - while (cnt < sizeof(one_mb_pipe_buf_1)) { - amt = read(0, one_mb_pipe_buf_1 + cnt, sizeof(one_mb_pipe_buf_1) - cnt); - if (amt == 0) { - break; - } - cnt += amt; - } - } - }
\ No newline at end of file diff --git a/test/bun.js/test_scope_debug.ts b/test/bun.js/test_scope_debug.ts deleted file mode 100644 index fbc79acd8..000000000 --- a/test/bun.js/test_scope_debug.ts +++ /dev/null @@ -1,172 +0,0 @@ -type AnyFunction = (...args: any[]) => any; -export function wrap({ - test: test_, - it: it_, - describe: describe_, - beforeEach: beforeEach_ = undefined, - beforeAll: beforeAll_ = undefined, - afterEach: afterEach_ = undefined, - afterAll: afterAll_ = undefined, -}: any) { - if (it_ === undefined) { - it_ = test_; - } - - var describe = (label, cb: AnyFunction) => { - return describe_( - label, - cb instanceof async function () {}.constructor - ? async () => { - console.log(`DESCRIBE [Enter] ${label}`); - try { - return await cb(); - } catch (e) { - throw e; - } finally { - console.log(`DESCRIBE [Exit] ${label}`); - } - } - : () => { - console.log(`DESCRIBE [Enter] ${label}`); - try { - return cb(); - } catch (e) { - throw e; - } finally { - console.log(`DESCRIBE [Exit] ${label}`); - } - }, - ); - }; - - var it = (label, cb: AnyFunction) => { - console.log("Before", label); - return it_( - label, - cb instanceof async function () {}.constructor - ? async () => { - console.log(`TEST [Enter] ${label}`); - try { - return await cb(); - } catch (e) { - throw e; - } finally { - console.log(`TEST [Exit] ${label}`); - } - } - : () => { - console.log(`TEST [Enter] ${label}`); - try { - return cb(); - } catch (e) { - throw e; - } finally { - console.log(`TEST [Exit] ${label}`); - } - }, - ); - }; - - var beforeEach = (cb: AnyFunction) => { - return beforeEach_( - cb instanceof async function () {}.constructor - ? async () => { - console.log(`BEFORE EACH [Enter]`); - try { - return await cb(); - } catch (e) { - throw e; - } finally { - console.log(`BEFORE EACH [Exit]`); - } - } - : () => { - console.log(`BEFORE EACH [Enter]`); - try { - return cb(); - } catch (e) { - throw e; - } finally { - console.log(`BEFORE EACH [Exit]`); - } - }, - ); - }; - var beforeAll = (cb: AnyFunction) => { - return beforeAll_( - cb instanceof async function () {}.constructor - ? async () => { - console.log(`BEFORE ALL [Enter]`); - try { - return await cb(); - } catch (e) { - throw e; - } finally { - console.log(`BEFORE ALL [Exit]`); - } - } - : () => { - console.log(`BEFORE ALL [Enter]`); - try { - return cb(); - } catch (e) { - throw e; - } finally { - console.log(`BEFORE ALL [Exit]`); - } - }, - ); - }; - var afterEach = (cb: AnyFunction) => { - return afterEach_( - cb instanceof async function () {}.constructor - ? async () => { - console.log(`AFTER EACH [Enter]`); - try { - return await cb(); - } catch (e) { - throw e; - } finally { - console.log(`AFTER EACH [Exit]`); - } - } - : () => { - console.log(`AFTER EACH [Enter]`); - try { - return cb(); - } catch (e) { - throw e; - } finally { - console.log(`AFTER EACH [Exit]`); - } - }, - ); - }; - var afterAll = (cb: AnyFunction) => { - return afterAll_( - cb instanceof async function () {}.constructor - ? async () => { - console.log(`AFTER ALL [Enter]`); - try { - return await cb(); - } catch (e) { - throw e; - } finally { - console.log(`AFTER ALL [Exit]`); - } - } - : () => { - console.log(`AFTER ALL [Enter]`); - try { - return cb(); - } catch (e) { - throw e; - } finally { - console.log(`AFTER ALL [Exit]`); - } - }, - ); - }; - - return { describe, it, beforeEach, beforeAll, afterEach, afterAll }; -} diff --git a/test/bun.js/tiny-typed-emitter.snapshot.js b/test/bun.js/tiny-typed-emitter.snapshot.js deleted file mode 100644 index 37299f986..000000000 --- a/test/bun.js/tiny-typed-emitter.snapshot.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * https://github.com/oven-sh/bun/issues/453 - */ -import { createRequire as topLevelCreateRequire } from "module"; -import { TypedEmitter as TypedEmitter7 } from "tiny-typed-emitter"; - -const require = topLevelCreateRequire(import.meta.url); diff --git a/test/bun.js/tsconfig.json b/test/bun.js/tsconfig.json deleted file mode 100644 index 0874dfd7e..000000000 --- a/test/bun.js/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowSyntheticDefaultImports": true, - "paths": { - "foo/bar": ["baz.js"], - "@faasjs/*": ["*.js"] - }, - "baseUrl": "." - }, - "exclude": ["solid-dom-fixtures", "bundled"] -} diff --git a/test/bun.lockb b/test/bun.lockb Binary files differnew file mode 100755 index 000000000..f724750a9 --- /dev/null +++ b/test/bun.lockb diff --git a/test/bun.js/decorators.test.ts b/test/bundler/decorators.test.ts index 134ae73ac..134ae73ac 100644 --- a/test/bun.js/decorators.test.ts +++ b/test/bundler/decorators.test.ts diff --git a/test/bun.js/inline.macro.js b/test/bundler/inline.macro.js index 8b157aa38..8b157aa38 100644 --- a/test/bun.js/inline.macro.js +++ b/test/bundler/inline.macro.js diff --git a/test/bun.js/macro-check.js b/test/bundler/macro-check.js index 0f494a4e7..0f494a4e7 100644 --- a/test/bun.js/macro-check.js +++ b/test/bundler/macro-check.js diff --git a/test/bun.js/transpiler.test.js b/test/bundler/transpiler.test.js index 352e0c2ec..352e0c2ec 100644 --- a/test/bun.js/transpiler.test.js +++ b/test/bundler/transpiler.test.js diff --git a/test/bun.js/hot-runner-imported.js b/test/cli/hot/hot-runner-imported.js index a763a17d6..a763a17d6 100644 --- a/test/bun.js/hot-runner-imported.js +++ b/test/cli/hot/hot-runner-imported.js diff --git a/test/bun.js/hot-runner.js b/test/cli/hot/hot-runner.js index eda65f0b9..eda65f0b9 100644 --- a/test/bun.js/hot-runner.js +++ b/test/cli/hot/hot-runner.js diff --git a/test/bun.js/hot.test.ts b/test/cli/hot/hot.test.ts index 174515507..88c7977f7 100644 --- a/test/bun.js/hot.test.ts +++ b/test/cli/hot/hot.test.ts @@ -1,7 +1,6 @@ import { spawn } from "bun"; import { expect, it } from "bun:test"; -import { bunEnv } from "bunEnv"; -import { bunExe } from "bunExe"; +import { bunExe, bunEnv } from "harness"; import { readFileSync, renameSync, rmSync, unlinkSync, writeFileSync } from "fs"; it("should hot reload when file is overwritten", async () => { diff --git a/test/bun.js/install/bad-workspace.test.ts b/test/cli/install/bad-workspace.test.ts index bb3f03a86..1feafc2b0 100644 --- a/test/bun.js/install/bad-workspace.test.ts +++ b/test/cli/install/bad-workspace.test.ts @@ -1,7 +1,6 @@ import { spawnSync } from "bun"; import { test, describe, expect } from "bun:test"; -import { bunEnv } from "bunEnv"; -import { bunExe } from "bunExe"; +import { bunExe, bunEnv } from "harness"; import { mkdirSync, rmSync, writeFileSync } from "fs"; test("bad workspace path", () => { diff --git a/test/bun.js/install/bar-0.0.2.tgz b/test/cli/install/bar-0.0.2.tgz Binary files differindex 1983142d7..1983142d7 100644 --- a/test/bun.js/install/bar-0.0.2.tgz +++ b/test/cli/install/bar-0.0.2.tgz diff --git a/test/bun.js/install/baz-0.0.3.tgz b/test/cli/install/baz-0.0.3.tgz Binary files differindex 375a5e31f..375a5e31f 100644 --- a/test/bun.js/install/baz-0.0.3.tgz +++ b/test/cli/install/baz-0.0.3.tgz diff --git a/test/bun.js/install/baz-0.0.5.tgz b/test/cli/install/baz-0.0.5.tgz Binary files differindex 7e708fb1b..7e708fb1b 100644 --- a/test/bun.js/install/baz-0.0.5.tgz +++ b/test/cli/install/baz-0.0.5.tgz diff --git a/test/bun.js/install/bun-add.test.ts b/test/cli/install/bun-add.test.ts index 9ac54bbc5..d1222993b 100644 --- a/test/bun.js/install/bun-add.test.ts +++ b/test/cli/install/bun-add.test.ts @@ -1,7 +1,6 @@ import { file, spawn } from "bun"; import { afterAll, afterEach, beforeAll, beforeEach, expect, it } from "bun:test"; -import { bunExe } from "bunExe"; -import { bunEnv as env } from "bunEnv"; +import { bunExe, bunEnv as env } from "harness"; import { access, mkdir, mkdtemp, readlink, realpath, rm, writeFile } from "fs/promises"; import { join, relative } from "path"; import { tmpdir } from "os"; diff --git a/test/bun.js/install/bun-install.test.ts b/test/cli/install/bun-install.test.ts index 3ea14f27c..ee515280e 100644 --- a/test/bun.js/install/bun-install.test.ts +++ b/test/cli/install/bun-install.test.ts @@ -1,7 +1,6 @@ import { file, listen, spawn } from "bun"; import { afterAll, afterEach, beforeAll, beforeEach, expect, it } from "bun:test"; -import { bunExe } from "bunExe"; -import { bunEnv as env } from "bunEnv"; +import { bunExe, bunEnv as env } from "harness"; import { access, mkdir, readlink, writeFile } from "fs/promises"; import { join } from "path"; import { diff --git a/test/bun.js/install/bun-link.test.ts b/test/cli/install/bun-link.test.ts index c1e1d1890..5b0abe139 100644 --- a/test/bun.js/install/bun-link.test.ts +++ b/test/cli/install/bun-link.test.ts @@ -1,7 +1,6 @@ import { spawn } from "bun"; import { afterAll, afterEach, beforeAll, beforeEach, expect, it } from "bun:test"; -import { bunExe } from "bunExe"; -import { bunEnv as env } from "bunEnv"; +import { bunExe, bunEnv as env } from "harness"; import { access, mkdtemp, readlink, realpath, rm, writeFile } from "fs/promises"; import { basename, join } from "path"; import { tmpdir } from "os"; diff --git a/test/bun.js/install/bun-pm.test.ts b/test/cli/install/bun-pm.test.ts index 3db2a4ad0..23b73dfae 100644 --- a/test/bun.js/install/bun-pm.test.ts +++ b/test/cli/install/bun-pm.test.ts @@ -1,7 +1,6 @@ import { spawn } from "bun"; import { afterAll, afterEach, beforeAll, beforeEach, expect, it } from "bun:test"; -import { bunExe } from "bunExe"; -import { bunEnv as env } from "bunEnv"; +import { bunExe, bunEnv as env } from "harness"; import { mkdir, writeFile } from "fs/promises"; import { join } from "path"; import { diff --git a/test/bun.js/install/bunx.test.ts b/test/cli/install/bunx.test.ts index 06266fe94..49d6e1c2d 100644 --- a/test/bun.js/install/bunx.test.ts +++ b/test/cli/install/bunx.test.ts @@ -1,7 +1,6 @@ import { spawn } from "bun"; import { afterEach, beforeEach, expect, it } from "bun:test"; -import { bunExe } from "bunExe"; -import { bunEnv as env } from "bunEnv"; +import { bunExe, bunEnv as env } from "harness"; import { realpathSync } from "fs"; import { mkdtemp, realpath, rm, writeFile } from "fs/promises"; import { tmpdir } from "os"; diff --git a/test/bun.js/install/dummy.registry.ts b/test/cli/install/dummy.registry.ts index d3fdc2d7f..d3fdc2d7f 100644 --- a/test/bun.js/install/dummy.registry.ts +++ b/test/cli/install/dummy.registry.ts diff --git a/test/bun.js/install/moo-0.1.0.tgz b/test/cli/install/moo-0.1.0.tgz Binary files differindex 72efff27b..72efff27b 100644 --- a/test/bun.js/install/moo-0.1.0.tgz +++ b/test/cli/install/moo-0.1.0.tgz diff --git a/test/bun.js/log-test.test.ts b/test/cli/run/log-test.test.ts index 29f541e32..2e980cb7b 100644 --- a/test/bun.js/log-test.test.ts +++ b/test/cli/run/log-test.test.ts @@ -2,8 +2,7 @@ import { it, expect } from "bun:test"; import { basename, dirname, join } from "path"; import * as fs from "fs"; import { readableStreamToText, spawnSync } from "bun"; -import { bunExe } from "bunExe"; -import { bunEnv } from "bunEnv"; +import { bunExe, bunEnv } from "harness"; it("should not log .env when quiet", async () => { writeDirectoryTree("/tmp/log-test-silent", { diff --git a/test/bun.js/preload-test.test.js b/test/cli/run/preload-test.test.js index 76603b3a0..e0e068f9a 100644 --- a/test/bun.js/preload-test.test.js +++ b/test/cli/run/preload-test.test.js @@ -3,8 +3,7 @@ import { describe, expect, test } from "bun:test"; import { mkdirSync, realpathSync } from "fs"; import { tmpdir } from "os"; import { join } from "path"; -import { bunEnv } from "./bunEnv"; -import { bunExe } from "./bunExe"; +import { bunEnv, bunExe } from "harness"; const preloadModule = ` import {plugin} from 'bun'; diff --git a/test/fixtures/bun-link-pkg-fixture/bun-link-pkg-fixture.js b/test/fixtures/bun-link-pkg-fixture/bun-link-pkg-fixture.js deleted file mode 100755 index ce5ae872b..000000000 --- a/test/fixtures/bun-link-pkg-fixture/bun-link-pkg-fixture.js +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env node - -// package.json name is bun-link-pkg-fixture-1 to ensure we don't rely on dir name -const _ = require("lodash"); - -if (_.isBoolean(true)) { - console.log("Success"); - process.exit(0); -} - -console.error("Fail"); -process.exit(1); diff --git a/test/fixtures/bun-link-pkg-fixture/bun.lockb b/test/fixtures/bun-link-pkg-fixture/bun.lockb Binary files differdeleted file mode 100755 index ff3a1483f..000000000 --- a/test/fixtures/bun-link-pkg-fixture/bun.lockb +++ /dev/null diff --git a/test/fixtures/bun-link-pkg-fixture/package-lock.json b/test/fixtures/bun-link-pkg-fixture/package-lock.json deleted file mode 100644 index 6296eb120..000000000 --- a/test/fixtures/bun-link-pkg-fixture/package-lock.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "bun-link-pkg-fixture-1", - "version": "0.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "bun-link-pkg-fixture-1", - "version": "0.0.0", - "dependencies": { - "lodash": "4.17.21" - }, - "bin": { - "bun-link-pkg-fixture": "bun-link-pkg-fixture.js" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - } - }, - "dependencies": { - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - } - } -} diff --git a/test/fixtures/bun-link-pkg-fixture/package.json b/test/fixtures/bun-link-pkg-fixture/package.json deleted file mode 100644 index 668847842..000000000 --- a/test/fixtures/bun-link-pkg-fixture/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "bun-link-pkg-fixture-1", - "version": "0.0.0", - "dependencies": { - "lodash": "4.17.21" - }, - "main": "bun-link-pkg-fixture.js", - "bin": { - "bun-link-pkg-fixture": "bun-link-pkg-fixture.js" - } -} diff --git a/test/fixtures/bun-link-to-pkg-fixture/.gitignore b/test/fixtures/bun-link-to-pkg-fixture/.gitignore deleted file mode 100644 index f81d56eaa..000000000 --- a/test/fixtures/bun-link-to-pkg-fixture/.gitignore +++ /dev/null @@ -1,169 +0,0 @@ -# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore - -# Logs - -logs -_.log -npm-debug.log_ -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) - -report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json - -# Runtime data - -pids -_.pid -_.seed -\*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover - -lib-cov - -# Coverage directory used by tools like istanbul - -coverage -\*.lcov - -# nyc test coverage - -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) - -.grunt - -# Bower dependency directory (https://bower.io/) - -bower_components - -# node-waf configuration - -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) - -build/Release - -# Dependency directories - -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) - -web_modules/ - -# TypeScript cache - -\*.tsbuildinfo - -# Optional npm cache directory - -.npm - -# Optional eslint cache - -.eslintcache - -# Optional stylelint cache - -.stylelintcache - -# Microbundle cache - -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history - -.node_repl_history - -# Output of 'npm pack' - -\*.tgz - -# Yarn Integrity file - -.yarn-integrity - -# dotenv environment variable files - -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) - -.cache -.parcel-cache - -# Next.js build output - -.next -out - -# Nuxt.js build / generate output - -.nuxt -dist - -# Gatsby files - -.cache/ - -# Comment in the public line in if your project uses Gatsby and not Next.js - -# https://nextjs.org/blog/next-9-1#public-directory-support - -# public - -# vuepress build output - -.vuepress/dist - -# vuepress v2.x temp and cache directory - -.temp -.cache - -# Docusaurus cache and generated files - -.docusaurus - -# Serverless directories - -.serverless/ - -# FuseBox cache - -.fusebox/ - -# DynamoDB Local files - -.dynamodb/ - -# TernJS port file - -.tern-port - -# Stores VSCode versions used for testing VSCode extensions - -.vscode-test - -# yarn v2 - -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.\* diff --git a/test/fixtures/bun-link-to-pkg-fixture/README.md b/test/fixtures/bun-link-to-pkg-fixture/README.md deleted file mode 100644 index ac47fd797..000000000 --- a/test/fixtures/bun-link-to-pkg-fixture/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# bun-link-to-pkg-fixture - -To install dependencies: - -```bash -bun install -``` - -To run: - -```bash -bun run index.ts -``` - -This project was created using `bun init` in bun v0.1.7. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. diff --git a/test/fixtures/bun-link-to-pkg-fixture/bun.lockb b/test/fixtures/bun-link-to-pkg-fixture/bun.lockb Binary files differdeleted file mode 100755 index 1f6e25aa6..000000000 --- a/test/fixtures/bun-link-to-pkg-fixture/bun.lockb +++ /dev/null diff --git a/test/fixtures/bun-link-to-pkg-fixture/index.js b/test/fixtures/bun-link-to-pkg-fixture/index.js deleted file mode 100644 index 2a5e4b80c..000000000 --- a/test/fixtures/bun-link-to-pkg-fixture/index.js +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello via Bun!"); diff --git a/test/fixtures/bun-link-to-pkg-fixture/package.json b/test/fixtures/bun-link-to-pkg-fixture/package.json deleted file mode 100644 index 952d8bb30..000000000 --- a/test/fixtures/bun-link-to-pkg-fixture/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "bun-link-to-pkg-fixture", - "module": "index.js", - "type": "module", - "devDependencies": { - "bun-types": "^0.1.0" - }, - "dependencies": { - "bun-link-pkg-fixture": "link:bun-link-pkg-fixture-1", - "bun-link-pkg-fixture-1": "link:bun-link-pkg-fixture-1" - } -}
\ No newline at end of file diff --git a/test/fixtures/bun-link-to-pkg-fixture/tsconfig.json b/test/fixtures/bun-link-to-pkg-fixture/tsconfig.json deleted file mode 100644 index feee4b584..000000000 --- a/test/fixtures/bun-link-to-pkg-fixture/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "lib": ["ESNext"], - "module": "esnext", - "target": "esnext", - "moduleResolution": "node", - - // so that if your project isn't using TypeScript, it still has autocomplete - "allowJs": true, - - // "bun-types" is the important part - "types": ["bun-types"] - } -} diff --git a/test/bun.js/gc.ts b/test/harness.ts index b9d80116d..486381cf2 100644 --- a/test/bun.js/gc.ts +++ b/test/harness.ts @@ -1,3 +1,14 @@ +export const bunEnv: any = { + ...process.env, + BUN_DEBUG_QUIET_LOGS: "1", + NO_COLOR: "1", + FORCE_COLOR: undefined, +}; + +export function bunExe() { + return process.execPath; +} + export function gc(force: boolean = true) { Bun.gc(force); } @@ -13,7 +24,7 @@ export function gcTick(trace = false) { }); } -export function withoutAggressiveGC(block) { +export function withoutAggressiveGC(block: () => unknown) { if (!Bun.unsafe.gcAggressionLevel) return block(); const origGC = Bun.unsafe.gcAggressionLevel(); diff --git a/test/bun.js/console/console-iterator-run.js b/test/js/bun/console/console-iterator-run.js index 7664c85a1..7664c85a1 100644 --- a/test/bun.js/console/console-iterator-run.js +++ b/test/js/bun/console/console-iterator-run.js diff --git a/test/bun.js/console/console-iterator.test.js b/test/js/bun/console/console-iterator.test.js index 053e4382d..89894fd72 100644 --- a/test/bun.js/console/console-iterator.test.js +++ b/test/js/bun/console/console-iterator.test.js @@ -1,6 +1,6 @@ import { spawnSync, spawn } from "bun"; import { describe, expect, it } from "bun:test"; -import { bunExe } from "bunExe"; +import { bunExe } from "harness"; describe("should work for static input", () => { const inputs = [ diff --git a/test/bun.js/resolve-dns.test.ts b/test/js/bun/dns/resolve-dns.test.ts index d83e23b56..52534da13 100644 --- a/test/bun.js/resolve-dns.test.ts +++ b/test/js/bun/dns/resolve-dns.test.ts @@ -1,6 +1,6 @@ import { dns } from "bun"; import { describe, expect, it, test } from "bun:test"; -import { withoutAggressiveGC } from "gc"; +import { withoutAggressiveGC } from "harness"; describe("dns.lookup", () => { const backends = [process.platform === "darwin" ? "system" : undefined, "libc", "c-ares"].filter(Boolean); @@ -28,7 +28,7 @@ describe("dns.lookup", () => { const [first, second] = await dns.lookup("google.com", { backend }); console.log(first, second); }); - it(backend + " local", async () => { + it.skip(backend + " local", async () => { const [first, second] = await dns.lookup("localhost", { backend }); console.log(first, second); }); diff --git a/test/bun.js/ffi-test.c b/test/js/bun/ffi/ffi-test.c index 0fe227385..0fe227385 100644 --- a/test/bun.js/ffi-test.c +++ b/test/js/bun/ffi/ffi-test.c diff --git a/test/bun.js/ffi.test.fixture.callback.c b/test/js/bun/ffi/ffi.test.fixture.callback.c index 3b9a46577..624f6cdd0 100644 --- a/test/bun.js/ffi.test.fixture.callback.c +++ b/test/js/bun/ffi/ffi.test.fixture.callback.c @@ -286,9 +286,6 @@ ZIG_REPR_TYPE JSFunctionCall(void* jsGlobalObject, void* callFrame); bool my_callback_function(void* arg0); bool my_callback_function(void* arg0) { -#ifdef INJECT_BEFORE -INJECT_BEFORE; -#endif ZIG_REPR_TYPE arguments[1]; arguments[0] = PTR_TO_JSVALUE(arg0).asZigRepr; return (bool)JSVALUE_TO_BOOL(_FFI_Callback_call((void*)0x0000000000000000ULL, 1, arguments)); diff --git a/test/bun.js/ffi.test.fixture.receiver.c b/test/js/bun/ffi/ffi.test.fixture.receiver.c index 0299a961b..0299a961b 100644 --- a/test/bun.js/ffi.test.fixture.receiver.c +++ b/test/js/bun/ffi/ffi.test.fixture.receiver.c diff --git a/test/bun.js/ffi.test.js b/test/js/bun/ffi/ffi.test.js index 102737782..8b31280c9 100644 --- a/test/bun.js/ffi.test.js +++ b/test/js/bun/ffi/ffi.test.js @@ -1,5 +1,5 @@ import { afterAll, describe, expect, it } from "bun:test"; -// +import { existsSync } from "fs"; import { CFunction, CString, @@ -20,6 +20,7 @@ const dlopen = (...args) => { throw err; } }; +const ok = existsSync("/tmp/bun-ffi-test.dylib"); it("ffi print", async () => { await Bun.write( @@ -607,7 +608,11 @@ it("read", () => { } }); -describe("run ffi", () => { - ffiRunner(false); - ffiRunner(true); -}); +if (ok) { + describe("run ffi", () => { + ffiRunner(false); + ffiRunner(true); + }); +} else { + it.skip("run ffi", () => {}); +} diff --git a/test/bun.js/globals.test.js b/test/js/bun/globals.test.js index 5d491cde7..5d491cde7 100644 --- a/test/bun.js/globals.test.js +++ b/test/js/bun/globals.test.js diff --git a/test/bun.js/bun-server.test.ts b/test/js/bun/http/bun-server.test.ts index 52574d2a3..52574d2a3 100644 --- a/test/bun.js/bun-server.test.ts +++ b/test/js/bun/http/bun-server.test.ts diff --git a/test/bun.js/fetch.js.txt b/test/js/bun/http/fetch.js.txt index 5a9b52fcf..5a9b52fcf 100644 --- a/test/bun.js/fetch.js.txt +++ b/test/js/bun/http/fetch.js.txt diff --git a/test/bun.js/fixture.html.gz b/test/js/bun/http/fixture.html.gz Binary files differindex 0bb85d4cb..0bb85d4cb 100644 --- a/test/bun.js/fixture.html.gz +++ b/test/js/bun/http/fixture.html.gz diff --git a/test/bun.js/proxy.test.js b/test/js/bun/http/proxy.test.js index c903efab3..abe05133d 100644 --- a/test/bun.js/proxy.test.js +++ b/test/js/bun/http/proxy.test.js @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from "bun:test"; -import { gc } from "./gc"; +import { gc } from "harness"; let proxy, server; diff --git a/test/leaks/http-static-leak.ts b/test/js/bun/http/serve.leak.ts index 09935d24d..09935d24d 100644 --- a/test/leaks/http-static-leak.ts +++ b/test/js/bun/http/serve.leak.ts diff --git a/test/bun.js/serve.test.ts b/test/js/bun/http/serve.test.ts index c049aad1a..c049aad1a 100644 --- a/test/bun.js/serve.test.ts +++ b/test/js/bun/http/serve.test.ts diff --git a/test/bun.js/bun-streams-test-fifo.sh b/test/js/bun/io/bun-streams-test-fifo.sh index 57650ba1d..57650ba1d 100644 --- a/test/bun.js/bun-streams-test-fifo.sh +++ b/test/js/bun/io/bun-streams-test-fifo.sh diff --git a/test/bun.js/bun-write.test.js b/test/js/bun/io/bun-write.test.js index c324d36a0..c3b9b187b 100644 --- a/test/bun.js/bun-write.test.js +++ b/test/js/bun/io/bun-write.test.js @@ -1,7 +1,7 @@ import fs from "fs"; import { it, expect, describe } from "bun:test"; import path from "path"; -import { gcTick, withoutAggressiveGC } from "./gc"; +import { gcTick, withoutAggressiveGC } from "harness"; it("Bun.write blob", async () => { await Bun.write(Bun.file("/tmp/response-file.test.txt"), Bun.file(path.join(import.meta.dir, "fetch.js.txt"))); diff --git a/test/bun.js/emptyFile b/test/js/bun/io/emptyFile index e69de29bb..e69de29bb 100644 --- a/test/bun.js/emptyFile +++ b/test/js/bun/io/emptyFile diff --git a/test/js/bun/io/fetch.js.txt b/test/js/bun/io/fetch.js.txt new file mode 100644 index 000000000..5a9b52fcf --- /dev/null +++ b/test/js/bun/io/fetch.js.txt @@ -0,0 +1,46 @@ +<!doctype html> +<html> +<head> + <title>Example Domain</title> + + <meta charset="utf-8" /> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <style type="text/css"> + body { + background-color: #f0f0f2; + margin: 0; + padding: 0; + font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + + } + div { + width: 600px; + margin: 5em auto; + padding: 2em; + background-color: #fdfdff; + border-radius: 0.5em; + box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02); + } + a:link, a:visited { + color: #38488f; + text-decoration: none; + } + @media (max-width: 700px) { + div { + margin: 0 auto; + width: auto; + } + } + </style> +</head> + +<body> +<div> + <h1>Example Domain</h1> + <p>This domain is for use in illustrative examples in documents. You may use this + domain in literature without prior coordination or asking for permission.</p> + <p><a href="https://www.iana.org/domains/example">More information...</a></p> +</div> +</body> +</html> diff --git a/test/bun.js/bun-jsc.test.js b/test/js/bun/jsc/bun-jsc.test.js index 6e6897eb3..6e6897eb3 100644 --- a/test/bun.js/bun-jsc.test.js +++ b/test/js/bun/jsc/bun-jsc.test.js diff --git a/test/bun.js/shadow.test.js b/test/js/bun/jsc/shadow.test.js index 3fffcac90..3fffcac90 100644 --- a/test/bun.js/shadow.test.js +++ b/test/js/bun/jsc/shadow.test.js diff --git a/test/bun.js/socket/echo.js b/test/js/bun/net/echo.js index f02637739..f02637739 100644 --- a/test/bun.js/socket/echo.js +++ b/test/js/bun/net/echo.js diff --git a/test/bun.js/socket/socket.test.ts b/test/js/bun/net/socket.test.ts index 4c58243ef..881175b24 100644 --- a/test/bun.js/socket/socket.test.ts +++ b/test/js/bun/net/socket.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "bun:test"; -import { bunExe } from "../bunExe"; +import { bunExe } from "harness"; import { connect, spawn } from "bun"; it("should keep process alive only when active", async () => { diff --git a/test/bun.js/tcp-server.test.ts b/test/js/bun/net/tcp-server.test.ts index 6f3f869ec..ba6927fe3 100644 --- a/test/bun.js/tcp-server.test.ts +++ b/test/js/bun/net/tcp-server.test.ts @@ -1,4 +1,4 @@ -import { listen, connect, TCPSocketListener, TCPSocketOptions, SocketHandler } from "bun"; +import { listen, connect, TCPSocketListener, SocketHandler } from "bun"; import { describe, expect, it } from "bun:test"; import * as JSC from "bun:jsc"; diff --git a/test/bun.js/hello.svelte b/test/js/bun/plugin/hello.svelte index 05dac4294..05dac4294 100644 --- a/test/bun.js/hello.svelte +++ b/test/js/bun/plugin/hello.svelte diff --git a/test/bun.js/hello2.svelte b/test/js/bun/plugin/hello2.svelte index 05dac4294..05dac4294 100644 --- a/test/bun.js/hello2.svelte +++ b/test/js/bun/plugin/hello2.svelte diff --git a/test/bun.js/plugins.d.ts b/test/js/bun/plugin/plugins.d.ts index aebfd952b..aebfd952b 100644 --- a/test/bun.js/plugins.d.ts +++ b/test/js/bun/plugin/plugins.d.ts diff --git a/test/bun.js/plugins.test.ts b/test/js/bun/plugin/plugins.test.ts index e533cef06..2bac4b4d4 100644 --- a/test/bun.js/plugins.test.ts +++ b/test/js/bun/plugin/plugins.test.ts @@ -131,7 +131,7 @@ plugin({ }); // This is to test that it works when imported from a separate file -import "bun-loader-svelte"; +import "../../third_party/svelte"; describe("require", () => { it("SSRs `<h1>Hello world!</h1>` with Svelte", () => { diff --git a/test/bun.js/baz.js b/test/js/bun/resolve/baz.js index 5837bb3bb..5837bb3bb 100644 --- a/test/bun.js/baz.js +++ b/test/js/bun/resolve/baz.js diff --git a/test/js/bun/resolve/file-importing-nonexistent-file.js b/test/js/bun/resolve/file-importing-nonexistent-file.js new file mode 100644 index 000000000..f805e78bc --- /dev/null +++ b/test/js/bun/resolve/file-importing-nonexistent-file.js @@ -0,0 +1 @@ +import "./does-not-exist.js.js.js.js"; diff --git a/test/bun.js/esm/first.mjs b/test/js/bun/resolve/first.mjs index 17021c623..17021c623 100644 --- a/test/bun.js/esm/first.mjs +++ b/test/js/bun/resolve/first.mjs diff --git a/test/bun.js/import-meta.test.js b/test/js/bun/resolve/import-meta.test.js index 3f89c09f0..f87c8f89f 100644 --- a/test/bun.js/import-meta.test.js +++ b/test/js/bun/resolve/import-meta.test.js @@ -1,7 +1,7 @@ import { it, expect } from "bun:test"; import { mkdirSync, rmSync, writeFileSync } from "node:fs"; import * as Module from "node:module"; -import sync from "./require-json.json"; +import sync from "./require-json.json.js"; const { path, dir } = import.meta; @@ -27,7 +27,7 @@ it("require with a query string works on dynamically created content", () => { try { const require = Module.createRequire("/tmp/bun-test-import-meta-dynamic-dir/foo.js"); try { - require("./bar.js?query=123"); + require("./bar.js?query=123.js"); } catch (e) { expect(e.name).toBe("ResolveError"); } @@ -36,7 +36,7 @@ it("require with a query string works on dynamically created content", () => { writeFileSync("/tmp/bun-test-import-meta-dynamic-dir/bar.js", "export default 'hello';", "utf8"); - expect(require("./bar.js?query=123").default).toBe("hello"); + expect(require("./bar.js?query=123.js").default).toBe("hello"); } catch (e) { throw e; } finally { @@ -50,7 +50,7 @@ it("require with a query string works on dynamically created content", () => { it("import.meta.require (json)", () => { expect(import.meta.require("./require-json.json").hello).toBe(sync.hello); const require = Module.createRequire(import.meta.path); - expect(require("./require-json.json").hello).toBe(sync.hello); + expect(require("./require-json.json.js").hello).toBe(sync.hello); }); it("const f = require;require(json)", () => { @@ -148,11 +148,11 @@ it("import.meta.require (javascript, live bindings)", () => { }); it("import.meta.dir", () => { - expect(dir.endsWith("/bun/test/bun.js")).toBe(true); + expect(dir.endsWith("/bun/test/js/bun/resolve")).toBe(true); }); it("import.meta.path", () => { - expect(path.endsWith("/bun/test/bun.js/import-meta.test.js")).toBe(true); + expect(path.endsWith("/bun/test/js/bun/resolve/import-meta.test.js")).toBe(true); }); it('require("bun") works', () => { diff --git a/test/bun.js/import-require-tla.js b/test/js/bun/resolve/import-require-tla.js index 732fc34dd..732fc34dd 100644 --- a/test/bun.js/import-require-tla.js +++ b/test/js/bun/resolve/import-require-tla.js diff --git a/test/bun.js/import.live.decl.js b/test/js/bun/resolve/import.live.decl.js index 46e67c9bd..46e67c9bd 100644 --- a/test/bun.js/import.live.decl.js +++ b/test/js/bun/resolve/import.live.decl.js diff --git a/test/bun.js/import.live.rexport-require.js b/test/js/bun/resolve/import.live.rexport-require.js index 10c993e08..10c993e08 100644 --- a/test/bun.js/import.live.rexport-require.js +++ b/test/js/bun/resolve/import.live.rexport-require.js diff --git a/test/js/bun/resolve/import.live.rexport.js b/test/js/bun/resolve/import.live.rexport.js new file mode 100644 index 000000000..6709c3466 --- /dev/null +++ b/test/js/bun/resolve/import.live.rexport.js @@ -0,0 +1,2 @@ +export { foo, setFoo } from "./import.live.decl.js"; +import { foo as bar } from "./import.live.decl.js"; diff --git a/test/bun.js/test-png-import.test.js b/test/js/bun/resolve/png/test-png-import.test.js index ca2d0b9ce..ca2d0b9ce 100644 --- a/test/bun.js/test-png-import.test.js +++ b/test/js/bun/resolve/png/test-png-import.test.js diff --git a/test/bun.js/test-png.png b/test/js/bun/resolve/png/test-png.png index e69de29bb..e69de29bb 100644 --- a/test/bun.js/test-png.png +++ b/test/js/bun/resolve/png/test-png.png diff --git a/test/bun.js/require-js-top-level-await.js b/test/js/bun/resolve/require-js-top-level-await.js index 16bff41c3..16bff41c3 100644 --- a/test/bun.js/require-js-top-level-await.js +++ b/test/js/bun/resolve/require-js-top-level-await.js diff --git a/test/bun.js/require-js.js b/test/js/bun/resolve/require-js.js index 36fc31432..36fc31432 100644 --- a/test/bun.js/require-js.js +++ b/test/js/bun/resolve/require-js.js diff --git a/test/bun.js/require-js2.js b/test/js/bun/resolve/require-js2.js index 518e69641..518e69641 100644 --- a/test/bun.js/require-js2.js +++ b/test/js/bun/resolve/require-js2.js diff --git a/test/bun.js/require-json.json b/test/js/bun/resolve/require-json.json index 6414edc0e..6414edc0e 100644 --- a/test/bun.js/require-json.json +++ b/test/js/bun/resolve/require-json.json diff --git a/test/bun.js/require-referenceerror.snapshot.js b/test/js/bun/resolve/require-referenceerror.snapshot.js index c52af3d22..c52af3d22 100644 --- a/test/bun.js/require-referenceerror.snapshot.js +++ b/test/js/bun/resolve/require-referenceerror.snapshot.js diff --git a/test/bun.js/resolve-error.test.ts b/test/js/bun/resolve/resolve-error.test.ts index cddd2c051..cddd2c051 100644 --- a/test/bun.js/resolve-error.test.ts +++ b/test/js/bun/resolve/resolve-error.test.ts diff --git a/test/bun.js/resolve-typescript-file.tsx b/test/js/bun/resolve/resolve-typescript-file.tsx index ff8b4c563..ff8b4c563 100644 --- a/test/bun.js/resolve-typescript-file.tsx +++ b/test/js/bun/resolve/resolve-typescript-file.tsx diff --git a/test/bun.js/resolve.test.js b/test/js/bun/resolve/resolve.test.js index 305a374a2..305a374a2 100644 --- a/test/bun.js/resolve.test.js +++ b/test/js/bun/resolve/resolve.test.js diff --git a/test/bun.js/esm/second-child.mjs b/test/js/bun/resolve/second-child.mjs index 5fb06ed45..5fb06ed45 100644 --- a/test/bun.js/esm/second-child.mjs +++ b/test/js/bun/resolve/second-child.mjs diff --git a/test/bun.js/esm/second.mjs b/test/js/bun/resolve/second.mjs index 888eb11b9..888eb11b9 100644 --- a/test/bun.js/esm/second.mjs +++ b/test/js/bun/resolve/second.mjs diff --git a/test/bun.js/esm/startEnd.mjs b/test/js/bun/resolve/startEnd.mjs index 8b5549802..8b5549802 100644 --- a/test/bun.js/esm/startEnd.mjs +++ b/test/js/bun/resolve/startEnd.mjs diff --git a/test/bun.js/esm/third.mjs b/test/js/bun/resolve/third.mjs index f5ba5cc84..f5ba5cc84 100644 --- a/test/bun.js/esm/third.mjs +++ b/test/js/bun/resolve/third.mjs diff --git a/test/bun.js/toml-fixture.toml b/test/js/bun/resolve/toml/toml-fixture.toml index 090563ef7..090563ef7 100644 --- a/test/bun.js/toml-fixture.toml +++ b/test/js/bun/resolve/toml/toml-fixture.toml diff --git a/test/bun.js/toml.test.js b/test/js/bun/resolve/toml/toml.test.js index a1aa09a4c..17d167476 100644 --- a/test/bun.js/toml.test.js +++ b/test/js/bun/resolve/toml/toml.test.js @@ -1,5 +1,5 @@ import { describe, it, expect } from "bun:test"; -import { gc } from "./gc"; +import { gc } from "harness"; it("syntax", async () => { gc(); diff --git a/test/bun.js/bash-echo.sh b/test/js/bun/spawn/bash-echo.sh index 57bca4b01..57bca4b01 100644 --- a/test/bun.js/bash-echo.sh +++ b/test/js/bun/spawn/bash-echo.sh diff --git a/test/bun.js/bun-spawn-test.js b/test/js/bun/spawn/bun-spawn-test.js index 1617a8588..1617a8588 100644 --- a/test/bun.js/bun-spawn-test.js +++ b/test/js/bun/spawn/bun-spawn-test.js diff --git a/test/bun.js/exit-code-0.js b/test/js/bun/spawn/exit-code-0.js index dcbbff6c9..dcbbff6c9 100644 --- a/test/bun.js/exit-code-0.js +++ b/test/js/bun/spawn/exit-code-0.js diff --git a/test/bun.js/exit-code-1.js b/test/js/bun/spawn/exit-code-1.js index 6cee2e1e7..6cee2e1e7 100644 --- a/test/bun.js/exit-code-1.js +++ b/test/js/bun/spawn/exit-code-1.js diff --git a/test/bun.js/exit-code-await-throw-1.js b/test/js/bun/spawn/exit-code-await-throw-1.js index 6b8c42eab..6b8c42eab 100644 --- a/test/bun.js/exit-code-await-throw-1.js +++ b/test/js/bun/spawn/exit-code-await-throw-1.js diff --git a/test/bun.js/exit-code-unhandled-throw.js b/test/js/bun/spawn/exit-code-unhandled-throw.js index e8f5ca4cb..e8f5ca4cb 100644 --- a/test/bun.js/exit-code-unhandled-throw.js +++ b/test/js/bun/spawn/exit-code-unhandled-throw.js diff --git a/test/bun.js/exit-code.test.ts b/test/js/bun/spawn/exit-code.test.ts index 5f1aab904..cda76a395 100644 --- a/test/bun.js/exit-code.test.ts +++ b/test/js/bun/spawn/exit-code.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, test } from "bun:test"; -import { bunExe } from "bunExe"; +import { bunExe } from "harness"; import { spawnSync } from "bun"; it("process.exit(1) works", () => { diff --git a/test/bun.js/exit.js b/test/js/bun/spawn/exit.js index fb28b1fb4..fb28b1fb4 100644 --- a/test/bun.js/exit.js +++ b/test/js/bun/spawn/exit.js diff --git a/test/bun.js/spawn-streaming-stdin.test.ts b/test/js/bun/spawn/spawn-streaming-stdin.test.ts index 02067b719..e2d346ec8 100644 --- a/test/bun.js/spawn-streaming-stdin.test.ts +++ b/test/js/bun/spawn/spawn-streaming-stdin.test.ts @@ -1,9 +1,7 @@ import { it, test, expect } from "bun:test"; import { spawn } from "bun"; -import { bunExe } from "./bunExe"; -import { gcTick } from "gc"; +import { bunExe, bunEnv, gcTick } from "harness"; import { closeSync, openSync } from "fs"; -import { bunEnv } from "./bunEnv"; const N = 100; test("spawn can write to stdin multiple chunks", async () => { diff --git a/test/bun.js/spawn-streaming-stdout-repro.js b/test/js/bun/spawn/spawn-streaming-stdout-repro.js index 3976ff095..3976ff095 100644 --- a/test/bun.js/spawn-streaming-stdout-repro.js +++ b/test/js/bun/spawn/spawn-streaming-stdout-repro.js diff --git a/test/bun.js/spawn-streaming-stdout.test.ts b/test/js/bun/spawn/spawn-streaming-stdout.test.ts index bda1031ad..75e36ca2c 100644 --- a/test/bun.js/spawn-streaming-stdout.test.ts +++ b/test/js/bun/spawn/spawn-streaming-stdout.test.ts @@ -1,9 +1,7 @@ import { it, test, expect } from "bun:test"; import { spawn } from "bun"; -import { bunExe } from "./bunExe"; -import { gcTick } from "gc"; +import { bunExe, bunEnv, gcTick } from "harness"; import { closeSync, openSync } from "fs"; -import { bunEnv } from "./bunEnv"; test("spawn can read from stdout multiple chunks", async () => { gcTick(true); diff --git a/test/bun.js/spawn.test.ts b/test/js/bun/spawn/spawn.test.ts index def0330ee..876985e66 100644 --- a/test/bun.js/spawn.test.ts +++ b/test/js/bun/spawn/spawn.test.ts @@ -1,8 +1,7 @@ import { ArrayBufferSink, readableStreamToText, spawn, spawnSync, write } from "bun"; import { describe, expect, it } from "bun:test"; -import { gcTick as _gcTick } from "./gc"; +import { gcTick as _gcTick, bunEnv } from "harness"; import { rmdirSync, unlinkSync, rmSync, writeFileSync } from "node:fs"; -import { bunEnv } from "./bunEnv"; for (let [gcTick, label] of [ [_gcTick, "gcTick"], diff --git a/test/bun.js/stdin-repro.js b/test/js/bun/spawn/stdin-repro.js index 02840d00b..02840d00b 100644 --- a/test/bun.js/stdin-repro.js +++ b/test/js/bun/spawn/stdin-repro.js diff --git a/test/bun.js/stdio-test-instance-a-lot.js b/test/js/bun/spawn/stdio-test-instance-a-lot.js index 71815ddea..71815ddea 100644 --- a/test/bun.js/stdio-test-instance-a-lot.js +++ b/test/js/bun/spawn/stdio-test-instance-a-lot.js diff --git a/test/bun.js/stdio-test-instance.js b/test/js/bun/spawn/stdio-test-instance.js index fd820dc25..fd820dc25 100644 --- a/test/bun.js/stdio-test-instance.js +++ b/test/js/bun/spawn/stdio-test-instance.js diff --git a/test/bun.js/northwind.testdb b/test/js/bun/sqlite/northwind.testdb Binary files differindex 66f01fdd2..66f01fdd2 100644 --- a/test/bun.js/northwind.testdb +++ b/test/js/bun/sqlite/northwind.testdb diff --git a/test/bun.js/sql-raw.test.js b/test/js/bun/sqlite/sql-raw.test.js index 9b6312dda..9b6312dda 100644 --- a/test/bun.js/sql-raw.test.js +++ b/test/js/bun/sqlite/sql-raw.test.js diff --git a/test/bun.js/sqlite-cross-process.js b/test/js/bun/sqlite/sqlite-cross-process.js index d5b9b87b5..d5b9b87b5 100644 --- a/test/bun.js/sqlite-cross-process.js +++ b/test/js/bun/sqlite/sqlite-cross-process.js diff --git a/test/bun.js/sqlite.test.js b/test/js/bun/sqlite/sqlite.test.js index 408fa5a26..a23c2f037 100644 --- a/test/bun.js/sqlite.test.js +++ b/test/js/bun/sqlite/sqlite.test.js @@ -2,7 +2,7 @@ import { expect, it, describe } from "bun:test"; import { Database, constants } from "bun:sqlite"; import { existsSync, fstat, realpathSync, rmSync, writeFileSync } from "fs"; import { spawnSync } from "bun"; -import { bunExe } from "bunExe"; +import { bunExe } from "harness"; import { tmpdir } from "os"; var encode = text => new TextEncoder().encode(text); diff --git a/test/bun.js/bigint.test.js b/test/js/bun/test/bigint.test.js index 46ad50b84..46ad50b84 100644 --- a/test/bun.js/bigint.test.js +++ b/test/js/bun/test/bigint.test.js diff --git a/test/bun.js/bun-test.test.ts b/test/js/bun/test/bun-test.test.ts index cc6bf644a..cc6bf644a 100644 --- a/test/bun.js/bun-test.test.ts +++ b/test/js/bun/test/bun-test.test.ts diff --git a/test/bun.js/jest-doesnt-auto-import.js b/test/js/bun/test/jest-doesnt-auto-import.js index 4d4a02b37..4d4a02b37 100644 --- a/test/bun.js/jest-doesnt-auto-import.js +++ b/test/js/bun/test/jest-doesnt-auto-import.js diff --git a/test/bun.js/bun-test/jest-hooks.test.ts b/test/js/bun/test/jest-hooks.test.ts index c99dc7759..c99dc7759 100644 --- a/test/bun.js/bun-test/jest-hooks.test.ts +++ b/test/js/bun/test/jest-hooks.test.ts diff --git a/test/bun.js/bun-test/nested-describes.test.ts b/test/js/bun/test/nested-describes.test.ts index 636714fdc..636714fdc 100644 --- a/test/bun.js/bun-test/nested-describes.test.ts +++ b/test/js/bun/test/nested-describes.test.ts diff --git a/test/bun.js/test-auto-import-jest-globals.test.js b/test/js/bun/test/test-auto-import-jest-globals.test.js index 5baeae43e..5baeae43e 100644 --- a/test/bun.js/test-auto-import-jest-globals.test.js +++ b/test/js/bun/test/test-auto-import-jest-globals.test.js diff --git a/test/bun.js/test-test.test.ts b/test/js/bun/test/test-test.test.ts index c83ee07a5..b834d2152 100644 --- a/test/bun.js/test-test.test.ts +++ b/test/js/bun/test/test-test.test.ts @@ -1,7 +1,6 @@ import { spawn, spawnSync } from "bun"; import { describe, expect, it, test } from "bun:test"; -import { bunEnv } from "bunEnv"; -import { bunExe } from "bunExe"; +import { bunExe, bunEnv } from "harness"; import { mkdirSync, realpathSync, rmSync, writeFileSync } from "fs"; import { mkdtemp, rm, writeFile } from "fs/promises"; import { tmpdir } from "os"; diff --git a/test/bun.js/arraybuffersink.test.ts b/test/js/bun/util/arraybuffersink.test.ts index f0df03d90..373ac1116 100644 --- a/test/bun.js/arraybuffersink.test.ts +++ b/test/js/bun/util/arraybuffersink.test.ts @@ -1,6 +1,6 @@ import { ArrayBufferSink } from "bun"; import { describe, expect, it } from "bun:test"; -import { withoutAggressiveGC } from "gc"; +import { withoutAggressiveGC } from "harness"; describe("ArrayBufferSink", () => { const fixtures = [ diff --git a/test/bun.js/concat.test.js b/test/js/bun/util/concat.test.js index 36421cab6..0cea303fe 100644 --- a/test/bun.js/concat.test.js +++ b/test/js/bun/util/concat.test.js @@ -1,5 +1,4 @@ import { describe, it, expect } from "bun:test"; -import { gcTick } from "./gc"; import { concatArrayBuffers } from "bun"; describe("concat", () => { diff --git a/test/bun.js/empty.js b/test/js/bun/util/empty.js index cb0ff5c3b..cb0ff5c3b 100644 --- a/test/bun.js/empty.js +++ b/test/js/bun/util/empty.js diff --git a/test/bun.js/escapeHTML.test.js b/test/js/bun/util/escapeHTML.test.js index f96849a84..bdddf4a45 100644 --- a/test/bun.js/escapeHTML.test.js +++ b/test/js/bun/util/escapeHTML.test.js @@ -1,5 +1,4 @@ import { describe, it, expect } from "bun:test"; -import { gcTick } from "./gc"; import { escapeHTML } from "bun"; describe("escapeHTML", () => { diff --git a/test/bun.js/fileUrl.test.js b/test/js/bun/util/fileUrl.test.js index ebae570f8..ebae570f8 100644 --- a/test/bun.js/fileUrl.test.js +++ b/test/js/bun/util/fileUrl.test.js diff --git a/test/bun.js/filesink.test.ts b/test/js/bun/util/filesink.test.ts index 31fd70e54..31fd70e54 100644 --- a/test/bun.js/filesink.test.ts +++ b/test/js/bun/util/filesink.test.ts diff --git a/test/bun.js/filesystem_router.test.ts b/test/js/bun/util/filesystem_router.test.ts index b55e716c0..b55e716c0 100644 --- a/test/bun.js/filesystem_router.test.ts +++ b/test/js/bun/util/filesystem_router.test.ts diff --git a/test/bun.js/hash.test.js b/test/js/bun/util/hash.test.js index 0c1baaf14..87a5a9ce3 100644 --- a/test/bun.js/hash.test.js +++ b/test/js/bun/util/hash.test.js @@ -1,7 +1,7 @@ import fs from "fs"; import { it, expect } from "bun:test"; import path from "path"; -import { gcTick } from "gc"; +import { gcTick } from "harness"; it(`Bun.hash()`, () => { gcTick(); diff --git a/test/bun.js/index-of-line.test.ts b/test/js/bun/util/index-of-line.test.ts index 1c6cbaea2..1c6cbaea2 100644 --- a/test/bun.js/index-of-line.test.ts +++ b/test/js/bun/util/index-of-line.test.ts diff --git a/test/bun.js/inspect.test.js b/test/js/bun/util/inspect.test.js index 024a976a3..ec2fb0b45 100644 --- a/test/bun.js/inspect.test.js +++ b/test/js/bun/util/inspect.test.js @@ -278,7 +278,7 @@ const fixture = [ return new (import.meta.require("events").EventEmitter)(); }, async () => await import("node:assert"), - async () => await import("./empty.js"), + async () => await import("../../empty.js.js"), () => import.meta.require("./empty.js"), () => new Proxy({ yolo: 1 }, {}), () => diff --git a/test/bun.js/mmap.test.js b/test/js/bun/util/mmap.test.js index 2b15a4000..4972359da 100644 --- a/test/bun.js/mmap.test.js +++ b/test/js/bun/util/mmap.test.js @@ -1,5 +1,5 @@ import { describe, it, expect } from "bun:test"; -import { gcTick } from "./gc"; +import { gcTick } from "harness"; describe("Bun.mmap", async () => { await gcTick(); diff --git a/test/bun.js/peek.test.ts b/test/js/bun/util/peek.test.ts index 421c306d8..421c306d8 100644 --- a/test/bun.js/peek.test.ts +++ b/test/js/bun/util/peek.test.ts diff --git a/test/bun.js/reportError.test.js b/test/js/bun/util/reportError.test.js index e51f93309..e51f93309 100644 --- a/test/bun.js/reportError.test.js +++ b/test/js/bun/util/reportError.test.js diff --git a/test/bun.js/sleep.js b/test/js/bun/util/sleep.js index 1ec79e79d..1ec79e79d 100644 --- a/test/bun.js/sleep.js +++ b/test/js/bun/util/sleep.js diff --git a/test/bun.js/sleepSync.test.ts b/test/js/bun/util/sleepSync.test.ts index dd2e8818a..dd2e8818a 100644 --- a/test/bun.js/sleepSync.test.ts +++ b/test/js/bun/util/sleepSync.test.ts diff --git a/test/bun.js/unsafe.test.js b/test/js/bun/util/unsafe.test.js index 8ce7598db..38830fa36 100644 --- a/test/bun.js/unsafe.test.js +++ b/test/js/bun/util/unsafe.test.js @@ -1,5 +1,5 @@ import { test, expect, it, describe } from "bun:test"; -import { gc } from "./gc"; +import { gc } from "harness"; it("arrayBufferToString u8", async () => { var encoder = new TextEncoder(); diff --git a/test/bun.js/which.test.ts b/test/js/bun/util/which.test.ts index e142e398c..e142e398c 100644 --- a/test/bun.js/which.test.ts +++ b/test/js/bun/util/which.test.ts diff --git a/test/bun.js/hello-wasi.wasm b/test/js/bun/wasm/hello-wasi.wasm Binary files differindex e134bcee4..e134bcee4 100755 --- a/test/bun.js/hello-wasi.wasm +++ b/test/js/bun/wasm/hello-wasi.wasm diff --git a/test/bun.js/wasi.test.js b/test/js/bun/wasm/wasi.test.js index f6d8e76f5..ac1d986d4 100644 --- a/test/bun.js/wasi.test.js +++ b/test/js/bun/wasm/wasi.test.js @@ -1,7 +1,6 @@ import { spawnSync } from "bun"; import { expect, it } from "bun:test"; -import { bunEnv } from "bunEnv"; -import { bunExe } from "bunExe"; +import { bunExe, bunEnv } from "harness"; it("Should support printing 'hello world'", () => { const { stdout, exitCode } = spawnSync({ diff --git a/test/bun.js/wasm-return-1-test.zig b/test/js/bun/wasm/wasm-return-1-test.zig index d46bdae92..d46bdae92 100644 --- a/test/bun.js/wasm-return-1-test.zig +++ b/test/js/bun/wasm/wasm-return-1-test.zig diff --git a/test/bun.js/wasm.js b/test/js/bun/wasm/wasm.js index a4daaaffe..a4daaaffe 100644 --- a/test/bun.js/wasm.js +++ b/test/js/bun/wasm/wasm.js diff --git a/test/bun.js/websocket-server.test.ts b/test/js/bun/websocket/websocket-server.test.ts index 3205ff949..b3b2e57b5 100644 --- a/test/bun.js/websocket-server.test.ts +++ b/test/js/bun/websocket/websocket-server.test.ts @@ -1,20 +1,11 @@ import { describe, expect, it } from "bun:test"; -import { gcTick } from "./gc"; +import { gcTick } from "harness"; import { serve } from "bun"; -var port = 4301; -function getPort() { - if (port > 4444) { - port = 4321; - } - - return port++; -} - describe("websocket server", () => { it("can do publish()", async done => { var server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { ws.subscribe("all"); @@ -51,7 +42,7 @@ describe("websocket server", () => { it("can do publish() with publishToSelf: false", async done => { var server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { ws.subscribe("all"); @@ -92,7 +83,7 @@ describe("websocket server", () => { it("in close() should work", async () => { var count = 0; var server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { ws.subscribe("all"); @@ -152,7 +143,7 @@ describe("websocket server", () => { var resolve; console.trace("here"); var server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) {}, message(ws, msg) {}, @@ -196,7 +187,7 @@ describe("websocket server", () => { it("headers error doesn't crash", async () => { await new Promise<void>((resolve, reject) => { const server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { ws.close(); @@ -236,7 +227,7 @@ describe("websocket server", () => { }); it("can do hello world", async () => { const server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { server.stop(); @@ -290,7 +281,7 @@ describe("websocket server", () => { it("fetch() allows a Response object to be returned for an upgraded ServerWebSocket", () => { const server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { server.stop(); @@ -349,7 +340,7 @@ describe("websocket server", () => { it("fetch() allows a Promise<Response> object to be returned for an upgraded ServerWebSocket", () => { const server = serve({ - port: getPort(), + port: 0, websocket: { async open(ws) { server.stop(); @@ -409,7 +400,7 @@ describe("websocket server", () => { it("binaryType works", async () => { var done = false; const server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { server.stop(); @@ -471,7 +462,7 @@ describe("websocket server", () => { it("does not upgrade for non-websocket connections", async () => { await new Promise<void>(async (resolve, reject) => { var server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { ws.send("hello world"); @@ -497,7 +488,7 @@ describe("websocket server", () => { it("does not upgrade for non-websocket servers", async () => { await new Promise<void>(async (resolve, reject) => { const server = serve({ - port: getPort(), + port: 0, fetch(req, server) { server.stop(); expect(() => { @@ -515,7 +506,7 @@ describe("websocket server", () => { it("async can do hello world", async () => { const server = serve({ - port: getPort(), + port: 0, websocket: { async open(ws) { server.stop(true); @@ -555,7 +546,7 @@ describe("websocket server", () => { await new Promise<void>((resolve, reject) => { var websocket; var server = serve({ - port: getPort(), + port: 0, websocket: { async open(ws) { // we don't care about the data @@ -585,7 +576,7 @@ describe("websocket server", () => { await new Promise<void>((resolve, reject) => { var websocket; var server = serve({ - port: getPort(), + port: 0, websocket: { async open(ws) { // we don't care about the data @@ -613,7 +604,7 @@ describe("websocket server", () => { await new Promise<void>((resolve, reject) => { var websocket; var server = serve({ - port: getPort(), + port: 0, websocket: { async open(ws) { // we don't care about the data @@ -641,7 +632,7 @@ describe("websocket server", () => { await new Promise<void>((resolve, reject) => { var websocket; var server = serve({ - port: getPort(), + port: 0, websocket: { async open(ws) { // we don't care about the data @@ -667,7 +658,7 @@ describe("websocket server", () => { it("can do hello world corked", async () => { const server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { server.stop(); @@ -709,7 +700,7 @@ describe("websocket server", () => { it("can do some back and forth", async () => { var dataCount = 0; const server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { server.stop(); @@ -785,7 +776,7 @@ describe("websocket server", () => { var clientCounter = 0; const server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { server.stop(); @@ -846,7 +837,7 @@ describe("websocket server", () => { var serverCounter = 0; var clientCount = 0; const server = serve({ - port: getPort(), + port: 0, websocket: { open(ws) { server.stop(); diff --git a/test/bun.js/undici.test.ts b/test/js/first_party/undici/undici.test.ts index 603b7a03d..603b7a03d 100644 --- a/test/bun.js/undici.test.ts +++ b/test/js/first_party/undici/undici.test.ts diff --git a/test/bun.js/assert-test.test.ts b/test/js/node/assert/assert-test.test.ts index 1723b7d47..1723b7d47 100644 --- a/test/bun.js/assert-test.test.ts +++ b/test/js/node/assert/assert-test.test.ts diff --git a/test/bun.js/buffer.test.js b/test/js/node/buffer.test.js index b8fade4d2..568bf8d44 100644 --- a/test/bun.js/buffer.test.js +++ b/test/js/node/buffer.test.js @@ -1,5 +1,5 @@ import { describe, it, expect, beforeEach, afterEach, test } from "bun:test"; -import { gc } from "./gc"; +import { gc } from "harness"; const BufferModule = await import("buffer"); diff --git a/test/bun.js/child-process-stdio.test.js b/test/js/node/child_process/child-process-stdio.test.js index 43bcc771a..d0c6d9bc7 100644 --- a/test/bun.js/child-process-stdio.test.js +++ b/test/js/node/child_process/child-process-stdio.test.js @@ -1,7 +1,6 @@ import { describe, it, expect, beforeAll } from "bun:test"; import { spawn, execSync } from "node:child_process"; -import { bunExe } from "bunExe"; -import { bunEnv } from "bunEnv"; +import { bunExe, bunEnv } from "harness"; const CHILD_PROCESS_FILE = import.meta.dir + "/spawned-child.js"; const OUT_FILE = import.meta.dir + "/stdio-test-out.txt"; diff --git a/test/bun.js/child_process-node.test.js b/test/js/node/child_process/child_process-node.test.js index f2c18c67c..deb3bfb86 100644 --- a/test/bun.js/child_process-node.test.js +++ b/test/js/node/child_process/child_process-node.test.js @@ -1,8 +1,7 @@ import { beforeAll, describe, expect, it } from "bun:test"; import { ChildProcess, spawn, exec } from "node:child_process"; -import { throws, assert, createCallCheckCtx, createDoneDotAll } from "node-test-helpers"; +import { throws, assert, createCallCheckCtx, createDoneDotAll } from "node-harness"; import { tmpdir } from "node:os"; -import { gcTick } from "gc"; const strictEqual = (a, b) => expect(a).toStrictEqual(b); const debug = process.env.DEBUG ? console.log : () => {}; diff --git a/test/bun.js/child_process.test.ts b/test/js/node/child_process/child_process.test.ts index 7f2c6b383..167cbd8b0 100644 --- a/test/bun.js/child_process.test.ts +++ b/test/js/node/child_process/child_process.test.ts @@ -1,5 +1,5 @@ import { describe, it as it_, expect as expect_ } from "bun:test"; -import { gcTick } from "gc"; +import { gcTick } from "harness"; import { ChildProcess, spawn, execFile, exec, fork, spawnSync, execFileSync, execSync } from "node:child_process"; import { tmpdir } from "node:os"; import { promisify } from "node:util"; diff --git a/test/bun.js/readFileSync.txt b/test/js/node/child_process/readFileSync.txt index ddc94b988..ddc94b988 100644 --- a/test/bun.js/readFileSync.txt +++ b/test/js/node/child_process/readFileSync.txt diff --git a/test/bun.js/spawned-child.js b/test/js/node/child_process/spawned-child.js index 263c566f9..263c566f9 100644 --- a/test/bun.js/spawned-child.js +++ b/test/js/node/child_process/spawned-child.js diff --git a/test/bun.js/crypto-scrypt.test.js b/test/js/node/crypto/crypto-scrypt.test.js index 4b7412251..4b7412251 100644 --- a/test/bun.js/crypto-scrypt.test.js +++ b/test/js/node/crypto/crypto-scrypt.test.js diff --git a/test/bun.js/crypto.test.js b/test/js/node/crypto/crypto.test.js index b5b8e9286..b5b8e9286 100644 --- a/test/bun.js/crypto.test.js +++ b/test/js/node/crypto/crypto.test.js diff --git a/test/bun.js/node-crypto.test.js b/test/js/node/crypto/node-crypto.test.js index f148f4fe9..f148f4fe9 100644 --- a/test/bun.js/node-crypto.test.js +++ b/test/js/node/crypto/node-crypto.test.js diff --git a/test/bun.js/dirname.test.js b/test/js/node/dirname.test.js index 98292dc49..98292dc49 100644 --- a/test/bun.js/dirname.test.js +++ b/test/js/node/dirname.test.js diff --git a/test/bun.js/disabled-module.test.js b/test/js/node/disabled-module.test.js index c12676959..c12676959 100644 --- a/test/bun.js/disabled-module.test.js +++ b/test/js/node/disabled-module.test.js diff --git a/test/bun.js/dns.node.mjs b/test/js/node/dns/dns.node.mjs index e69de29bb..e69de29bb 100644 --- a/test/bun.js/dns.node.mjs +++ b/test/js/node/dns/dns.node.mjs diff --git a/test/bun.js/node-dns.test.js b/test/js/node/dns/node-dns.test.js index 6f4cac22f..6f4cac22f 100644 --- a/test/bun.js/node-dns.test.js +++ b/test/js/node/dns/node-dns.test.js diff --git a/test/bun.js/event-emitter.test.ts b/test/js/node/events/event-emitter.test.ts index 2bb891778..2bb891778 100644 --- a/test/bun.js/event-emitter.test.ts +++ b/test/js/node/events/event-emitter.test.ts diff --git a/test/bun.js/node-builtins.test.js b/test/js/node/events/node-builtins.test.js index 67050f31a..67050f31a 100644 --- a/test/bun.js/node-builtins.test.js +++ b/test/js/node/events/node-builtins.test.js diff --git a/test/fixtures/export-lazy-fs-streams/export-*-from.ts b/test/js/node/fs/export-*-from.ts index 1c2b97875..1c2b97875 100644 --- a/test/fixtures/export-lazy-fs-streams/export-*-from.ts +++ b/test/js/node/fs/export-*-from.ts diff --git a/test/fixtures/export-lazy-fs-streams/export-from.ts b/test/js/node/fs/export-from.ts index 5258f9fde..5258f9fde 100644 --- a/test/fixtures/export-lazy-fs-streams/export-from.ts +++ b/test/js/node/fs/export-from.ts diff --git a/test/bun.js/fs-stream.js b/test/js/node/fs/fs-stream.js index db56fdfaa..db56fdfaa 100644 --- a/test/bun.js/fs-stream.js +++ b/test/js/node/fs/fs-stream.js diff --git a/test/bun.js/fs-stream.link.js b/test/js/node/fs/fs-stream.link.js index 0cadae0e5..0cadae0e5 120000 --- a/test/bun.js/fs-stream.link.js +++ b/test/js/node/fs/fs-stream.link.js diff --git a/test/bun.js/fs.test.ts b/test/js/node/fs/fs.test.ts index 4c847d25a..48abef6cb 100644 --- a/test/bun.js/fs.test.ts +++ b/test/js/node/fs/fs.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it } from "bun:test"; -import { gc, gcTick } from "./gc"; +import { gc, gcTick } from "harness"; import fs, { closeSync, existsSync, @@ -32,11 +32,8 @@ import _promises from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { ReadStream as ReadStream_, WriteStream as WriteStream_ } from "../fixtures/export-lazy-fs-streams/export-from"; -import { - ReadStream as ReadStreamStar_, - WriteStream as WriteStreamStar_, -} from "../fixtures/export-lazy-fs-streams/export-*-from"; +import { ReadStream as ReadStream_, WriteStream as WriteStream_ } from "./export-from.js"; +import { ReadStream as ReadStreamStar_, WriteStream as WriteStreamStar_ } from "./export-*-from.js"; const Buffer = globalThis.Buffer || Uint8Array; diff --git a/test/js/node/fs/readFileSync.txt b/test/js/node/fs/readFileSync.txt new file mode 100644 index 000000000..ddc94b988 --- /dev/null +++ b/test/js/node/fs/readFileSync.txt @@ -0,0 +1 @@ +File read successfully
\ No newline at end of file diff --git a/test/js/node/fs/test.txt b/test/js/node/fs/test.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/js/node/fs/test.txt diff --git a/test/bun.js/writeFileSync.txt b/test/js/node/fs/writeFileSync.txt index a0fe4515f..a0fe4515f 100644 --- a/test/bun.js/writeFileSync.txt +++ b/test/js/node/fs/writeFileSync.txt diff --git a/test/bun.js/node-test-helpers.test.js b/test/js/node/harness.test.js index de00e30ca..de00e30ca 100644 --- a/test/bun.js/node-test-helpers.test.js +++ b/test/js/node/harness.test.js diff --git a/test/bun.js/node-test-helpers.ts b/test/js/node/harness.ts index 0eaa7d07b..227009a64 100644 --- a/test/bun.js/node-test-helpers.ts +++ b/test/js/node/harness.ts @@ -1,6 +1,5 @@ import { expect as expect_ } from "bun:test"; -// @ts-ignore -import { gcTick } from "gc"; +import { gcTick } from "harness"; import assertNode from "node:assert"; type DoneCb = (err?: Error) => any; diff --git a/test/bun.js/node-http.test.ts b/test/js/node/http/node-http.fixme.ts index 619d8cb35..d47002a6f 100644 --- a/test/bun.js/node-http.test.ts +++ b/test/js/node/http/node-http.fixme.ts @@ -1,6 +1,19 @@ import { describe, expect, it, beforeAll, afterAll } from "bun:test"; import { createServer, request, get, Agent, globalAgent, Server } from "node:http"; -import { createDoneDotAll } from "node-test-helpers"; +import { createDoneDotAll } from "node-harness"; + +function listen(server: any): Promise<URL> { + return new Promise((resolve, reject) => { + server.listen({ port: 0 }, (err, hostname, port) => { + if (err) { + reject(err); + } else { + resolve(new URL(`http://${hostname}:${port}`)); + } + }); + setTimeout(() => reject("Timed out"), 5000); + }); +} describe("node:http", () => { describe("createServer", async () => { @@ -10,9 +23,8 @@ describe("node:http", () => { res.writeHead(200, { "Content-Type": "text/plain" }); res.end("Hello World"); }); - server.listen(8123); - - const res = await fetch("http://localhost:8123/hello?world"); + const url = await listen(server); + const res = await fetch(new URL("/hello?world", url)); expect(await res.text()).toBe("Hello World"); server.close(); }); @@ -32,9 +44,8 @@ describe("node:http", () => { res.end(); }); }); - server.listen(8124); - - const res = await fetch("http://localhost:8124", { + const url = await listen(server); + const res = await fetch(url, { method: "POST", body: bodyBlob, }); @@ -59,9 +70,8 @@ describe("node:http", () => { res.end(); }); }); - server.listen(8125); - - const res = await fetch("http://localhost:8125", { + const url = await listen(server); + const res = await fetch(url, { method: "POST", body: bodyBlob, }); @@ -73,7 +83,7 @@ describe("node:http", () => { it("listen should return server", async () => { const server = createServer(); - const listenResponse = server.listen(8129); + const listenResponse = server.listen(0); expect(listenResponse instanceof Server).toBe(true); expect(listenResponse).toBe(server); listenResponse.close(); @@ -464,24 +474,25 @@ describe("node:http", () => { done(); }); - server.listen({ signal, port: 8130 }); + server.listen({ signal, port: 0 }); }); }); describe("get", () => { let server; - beforeAll(() => { + let url; + beforeAll(async () => { server = createServer((req, res) => { res.writeHead(200, { "Content-Type": "text/plain" }); res.end("Hello World"); }); - server.listen(8127); + url = await listen(server); }); afterAll(() => { server.close(); }); it("should make a standard GET request, like request", done => { - get("http://127.0.0.1:8127", res => { + get(url, res => { let data = ""; res.setEncoding("utf8"); res.on("data", chunk => { @@ -506,12 +517,12 @@ describe("node:http", () => { res.writeHead(200, { "Content-Type": "text/plain" }); res.end("Hello World"); }); - server.listen(8128, () => { + server.listen({ port: 0 }, (_, host, port) => { // Setup request after server is listening dummyReq = request( { - host: "localhost", - port: 8128, + host, + port, agent: dummyAgent, }, res => {}, @@ -570,7 +581,7 @@ describe("node:http", () => { server.close(); }); it("should attempt to make a standard GET request and abort", done => { - get(`http://127.0.0.1:${server_port}`, { signal: AbortSignal.timeout(5) }, res => { + get(`http://${server_host}:${server_port}`, { signal: AbortSignal.timeout(5) }, res => { let data = ""; res.setEncoding("utf8"); res.on("data", chunk => { diff --git a/test/bun.js/node-module-module.test.js b/test/js/node/module/node-module-module.test.js index 549b5e085..549b5e085 100644 --- a/test/bun.js/node-module-module.test.js +++ b/test/js/node/module/node-module-module.test.js diff --git a/test/bun.js/socket/node-net.test.ts b/test/js/node/net/node-net.test.ts index e6c17d931..e6c17d931 100644 --- a/test/bun.js/socket/node-net.test.ts +++ b/test/js/node/net/node-net.test.ts diff --git a/test/bun.js/os.test.js b/test/js/node/os/os.test.js index ea685cdb7..ea685cdb7 100644 --- a/test/bun.js/os.test.js +++ b/test/js/node/os/os.test.js diff --git a/test/bun.js/path.test.js b/test/js/node/path/path.test.js index ad5688ea7..ad5688ea7 100644 --- a/test/bun.js/path.test.js +++ b/test/js/node/path/path.test.js diff --git a/test/bun.js/print-process-args.js b/test/js/node/process/print-process-args.js index 0ab238122..0ab238122 100644 --- a/test/bun.js/print-process-args.js +++ b/test/js/node/process/print-process-args.js diff --git a/test/bun.js/process-args.test.js b/test/js/node/process/process-args.test.js index a2c79616f..4da3a5381 100644 --- a/test/bun.js/process-args.test.js +++ b/test/js/node/process/process-args.test.js @@ -1,6 +1,6 @@ import { spawn } from "bun"; import { test, expect } from "bun:test"; -import { bunExe } from "./bunExe"; +import { bunExe } from "harness"; test("args exclude run", async () => { const arg0 = process.argv[0]; diff --git a/test/bun.js/process-nexttick.js b/test/js/node/process/process-nexttick.js index c6b24ba14..c6b24ba14 100644 --- a/test/bun.js/process-nexttick.js +++ b/test/js/node/process/process-nexttick.js diff --git a/test/bun.js/process-nexttick.test.js b/test/js/node/process/process-nexttick.test.js index becf3c236..becf3c236 100644 --- a/test/bun.js/process-nexttick.test.js +++ b/test/js/node/process/process-nexttick.test.js diff --git a/test/bun.js/process-stdin-echo.js b/test/js/node/process/process-stdin-echo.js index e265cc76d..e265cc76d 100644 --- a/test/bun.js/process-stdin-echo.js +++ b/test/js/node/process/process-stdin-echo.js diff --git a/test/bun.js/process-stdio.test.ts b/test/js/node/process/process-stdio.test.ts index 6054eeeeb..463ab5fda 100644 --- a/test/bun.js/process-stdio.test.ts +++ b/test/js/node/process/process-stdio.test.ts @@ -1,6 +1,6 @@ import { spawn, spawnSync } from "bun"; import { describe, expect, it, test } from "bun:test"; -import { bunExe } from "bunExe"; +import { bunExe } from "harness"; import { isatty } from "tty"; test("process.stdin", () => { diff --git a/test/bun.js/process.test.js b/test/js/node/process/process.test.js index 8cc3e6b87..59f54c53f 100644 --- a/test/bun.js/process.test.js +++ b/test/js/node/process/process.test.js @@ -1,6 +1,6 @@ import { resolveSync, which } from "bun"; import { describe, expect, it } from "bun:test"; -import { readFileSync, realpathSync } from "fs"; +import { existsSync, readFileSync, realpathSync } from "fs"; import { basename } from "path"; it("process", () => { @@ -120,7 +120,8 @@ it("process.umask()", () => { expect(process.umask(orig)).toBe(777); }); -it("process.versions", () => { +const versions = existsSync(import.meta.dir + "/../../src/generated_versions_list.zig"); +(versions ? it : it.skip)("process.versions", () => { // Generate a list of all the versions in the versions object // example: // pub const boringssl = "b275c5ce1c88bc06f5a967026d3c0ce1df2be815"; diff --git a/test/bun.js/readline.node.test.ts b/test/js/node/readline/readline.node.test.ts index 4a6c4be8c..7dfa51ac8 100644 --- a/test/bun.js/readline.node.test.ts +++ b/test/js/node/readline/readline.node.test.ts @@ -2,7 +2,7 @@ import { beforeEach, describe, it } from "bun:test"; import readline from "node:readline"; import { Writable, PassThrough } from "node:stream"; import { EventEmitter } from "node:events"; -import { createDoneDotAll, createCallCheckCtx, assert } from "./node-test-helpers"; +import { createDoneDotAll, createCallCheckCtx, assert } from "node-harness"; var { CSI, diff --git a/test/bun.js/readline_promises.node.test.ts b/test/js/node/readline/readline_promises.node.test.ts index 93093aecd..c75d254ca 100644 --- a/test/bun.js/readline_promises.node.test.ts +++ b/test/js/node/readline/readline_promises.node.test.ts @@ -1,7 +1,7 @@ import { describe, it } from "bun:test"; import readlinePromises from "node:readline/promises"; import { EventEmitter } from "node:events"; -import { createDoneDotAll, createCallCheckCtx, assert } from "./node-test-helpers"; +import { createDoneDotAll, createCallCheckCtx, assert } from "node-harness"; // ---------------------------------------------------------------------------- // Helpers diff --git a/test/bun.js/bufferlist.test.ts b/test/js/node/stream/bufferlist.test.ts index b8a5443ea..b8a5443ea 100644 --- a/test/bun.js/bufferlist.test.ts +++ b/test/js/node/stream/bufferlist.test.ts diff --git a/test/bun.js/node-stream-uint8array.test.ts b/test/js/node/stream/node-stream-uint8array.test.ts index ec2e95d34..ec2e95d34 100644 --- a/test/bun.js/node-stream-uint8array.test.ts +++ b/test/js/node/stream/node-stream-uint8array.test.ts diff --git a/test/bun.js/node-stream.test.js b/test/js/node/stream/node-stream.test.js index 6bff28b94..6bff28b94 100644 --- a/test/bun.js/node-stream.test.js +++ b/test/js/node/stream/node-stream.test.js diff --git a/test/bun.js/string-decoder.test.js b/test/js/node/string_decoder/string-decoder.test.js index 4bc9d7e8b..f37326678 100644 --- a/test/bun.js/string-decoder.test.js +++ b/test/js/node/string_decoder/string-decoder.test.js @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { withoutAggressiveGC } from "gc"; +import { withoutAggressiveGC } from "harness"; const RealStringDecoder = require("string_decoder").StringDecoder; diff --git a/test/bun.js/node-timers.test.ts b/test/js/node/timers/node-timers.test.ts index e6fa48010..e6fa48010 100644 --- a/test/bun.js/node-timers.test.ts +++ b/test/js/node/timers/node-timers.test.ts diff --git a/test/bun.js/test-util-types.test.js b/test/js/node/util/test-util-types.test.js index f33ab4b1a..f33ab4b1a 100644 --- a/test/bun.js/test-util-types.test.js +++ b/test/js/node/util/test-util-types.test.js diff --git a/test/bun.js/util/util-promisify.test.js b/test/js/node/util/util-promisify.test.js index 336e070f7..336e070f7 100644 --- a/test/bun.js/util/util-promisify.test.js +++ b/test/js/node/util/util-promisify.test.js diff --git a/test/bun.js/util/util.test.js b/test/js/node/util/util.test.js index ff01b508b..ff01b508b 100644 --- a/test/bun.js/util/util.test.js +++ b/test/js/node/util/util.test.js diff --git a/test/bun.js/capture-stack-trace.test.js b/test/js/node/v8/capture-stack-trace.test.js index 789503960..789503960 100644 --- a/test/bun.js/capture-stack-trace.test.js +++ b/test/js/node/v8/capture-stack-trace.test.js diff --git a/test/js/node/zlib/fixture.html.gz b/test/js/node/zlib/fixture.html.gz Binary files differnew file mode 100644 index 000000000..0bb85d4cb --- /dev/null +++ b/test/js/node/zlib/fixture.html.gz diff --git a/test/bun.js/zlib.test.js b/test/js/node/zlib/zlib.test.js index 60f3fe23a..60f3fe23a 100644 --- a/test/bun.js/zlib.test.js +++ b/test/js/node/zlib/zlib.test.js diff --git a/test/bun.js/third-party/body-parser-test/bun.lockb b/test/js/third_party/body-parser/bun.lockb Binary files differindex 3986c6911..3986c6911 100755 --- a/test/bun.js/third-party/body-parser-test/bun.lockb +++ b/test/js/third_party/body-parser/bun.lockb diff --git a/test/bun.js/third-party/body-parser-test/express-body-parser-test.test.ts b/test/js/third_party/body-parser/express-body-parser-test.test.ts index 1f95b318e..1f95b318e 100644 --- a/test/bun.js/third-party/body-parser-test/express-body-parser-test.test.ts +++ b/test/js/third_party/body-parser/express-body-parser-test.test.ts diff --git a/test/bun.js/third-party/body-parser-test/package.json b/test/js/third_party/body-parser/package.json index 0dfa98c59..0dfa98c59 100644 --- a/test/bun.js/third-party/body-parser-test/package.json +++ b/test/js/third_party/body-parser/package.json diff --git a/test/js/third_party/esbuild/bun.lockb b/test/js/third_party/esbuild/bun.lockb Binary files differnew file mode 100755 index 000000000..f46c6aa5d --- /dev/null +++ b/test/js/third_party/esbuild/bun.lockb diff --git a/test/bun.js/esbuild-child_process.test.ts b/test/js/third_party/esbuild/esbuild-child_process.test.ts index 9c0daa523..adda89f9b 100644 --- a/test/bun.js/esbuild-child_process.test.ts +++ b/test/js/third_party/esbuild/esbuild-child_process.test.ts @@ -1,6 +1,6 @@ import { spawnSync } from "bun"; import { describe, it, expect, test } from "bun:test"; -import { bunExe } from "bunExe"; +import { bunExe } from "harness"; test("esbuild", () => { const { exitCode, stderr, stdout } = spawnSync([bunExe(), import.meta.dir + "/esbuild-test.js"], { diff --git a/test/bun.js/esbuild-test.js b/test/js/third_party/esbuild/esbuild-test.js index beb34b283..beb34b283 100644 --- a/test/bun.js/esbuild-test.js +++ b/test/js/third_party/esbuild/esbuild-test.js diff --git a/test/js/third_party/esbuild/package.json b/test/js/third_party/esbuild/package.json new file mode 100644 index 000000000..ad6bc55f6 --- /dev/null +++ b/test/js/third_party/esbuild/package.json @@ -0,0 +1,6 @@ +{ + "type": "module", + "dependencies": { + "esbuild": "^0.17.11" + } +}
\ No newline at end of file diff --git a/test/bun.js/third-party/napi_create_external/bun.lockb b/test/js/third_party/napi_create_external/bun.lockb Binary files differindex 7f6d3e95d..7f6d3e95d 100755 --- a/test/bun.js/third-party/napi_create_external/bun.lockb +++ b/test/js/third_party/napi_create_external/bun.lockb diff --git a/test/bun.js/third-party/napi_create_external/napi-create-external.test.ts b/test/js/third_party/napi_create_external/napi-create-external.test.ts index ca7e50b99..c3fe5ad65 100644 --- a/test/bun.js/third-party/napi_create_external/napi-create-external.test.ts +++ b/test/js/third_party/napi_create_external/napi-create-external.test.ts @@ -1,5 +1,5 @@ import { test, it, describe, expect } from "bun:test"; -import { withoutAggressiveGC } from "gc"; +import { withoutAggressiveGC } from "harness"; import * as _ from "lodash"; function rebase(str, inBase, outBase) { diff --git a/test/bun.js/third-party/napi_create_external/package.json b/test/js/third_party/napi_create_external/package.json index 82b0ef58d..659b279b2 100644 --- a/test/bun.js/third-party/napi_create_external/package.json +++ b/test/js/third_party/napi_create_external/package.json @@ -1,5 +1,6 @@ { "name": "napi-create-external-test", + "type": "module", "version": "1.0.0", "description": "Test for napi_create_external", "dependencies": { diff --git a/test/bun.js/react-dom-server.bun.cjs b/test/js/third_party/react-dom/react-dom-server.bun.cjs index f67e54a8c..f67e54a8c 100644 --- a/test/bun.js/react-dom-server.bun.cjs +++ b/test/js/third_party/react-dom/react-dom-server.bun.cjs diff --git a/test/bun.js/react-dom.test.tsx b/test/js/third_party/react-dom/react-dom.test.tsx index b484982e0..2f1309fb8 100644 --- a/test/bun.js/react-dom.test.tsx +++ b/test/js/third_party/react-dom/react-dom.test.tsx @@ -9,7 +9,7 @@ import { import { heapStats } from "bun:jsc"; import { describe, expect, it } from "bun:test"; import { renderToReadableStream as renderToReadableStreamBrowser } from "react-dom/server.browser"; -import { gc } from "./gc"; +import { gc } from "harness"; import { renderToReadableStream as renderToReadableStreamBun } from "./react-dom-server.bun.cjs"; import React from "react"; diff --git a/test/bun.js/bun-loader-svelte/bun-loader-svelte.ts b/test/js/third_party/svelte/bun-loader-svelte.ts index f0a6e3419..f0a6e3419 100644 --- a/test/bun.js/bun-loader-svelte/bun-loader-svelte.ts +++ b/test/js/third_party/svelte/bun-loader-svelte.ts diff --git a/test/js/third_party/svelte/hello.svelte b/test/js/third_party/svelte/hello.svelte new file mode 100644 index 000000000..05dac4294 --- /dev/null +++ b/test/js/third_party/svelte/hello.svelte @@ -0,0 +1,5 @@ +<script> + let name = "world"; +</script> + +<h1>Hello {name}!</h1> diff --git a/test/bun.js/bun-loader-svelte/package.json b/test/js/third_party/svelte/package.json index ae4958ccc..ae4958ccc 100644 --- a/test/bun.js/bun-loader-svelte/package.json +++ b/test/js/third_party/svelte/package.json diff --git a/test/js/third_party/svelte/svelte.test.ts b/test/js/third_party/svelte/svelte.test.ts new file mode 100644 index 000000000..44e36cce2 --- /dev/null +++ b/test/js/third_party/svelte/svelte.test.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from "bun:test"; +import "./bun-loader-svelte"; + +describe("require", () => { + it("SSRs `<h1>Hello world!</h1>` with Svelte", () => { + const { default: App } = require("./hello.svelte"); + const { html } = App.render(); + + expect(html).toBe("<h1>Hello world!</h1>"); + }); +}); + +describe("dynamic import", () => { + it("SSRs `<h1>Hello world!</h1>` with Svelte", async () => { + const { default: App }: any = await import("./hello.svelte"); + + const { html } = App.render(); + + expect(html).toBe("<h1>Hello world!</h1>"); + }); +}); diff --git a/test/bun.js/abort-signal-timeout.test.js b/test/js/web/abort/abort-signal-timeout.test.js index 7d741b2ad..7d741b2ad 100644 --- a/test/bun.js/abort-signal-timeout.test.js +++ b/test/js/web/abort/abort-signal-timeout.test.js diff --git a/test/bun.js/console/console-log.expected.txt b/test/js/web/console/console-log.expected.txt index 97191c8be..97191c8be 100644 --- a/test/bun.js/console/console-log.expected.txt +++ b/test/js/web/console/console-log.expected.txt diff --git a/test/bun.js/console/console-log.js b/test/js/web/console/console-log.js index e23a3e9cb..e23a3e9cb 100644 --- a/test/bun.js/console/console-log.js +++ b/test/js/web/console/console-log.js diff --git a/test/bun.js/console/console-log.test.ts b/test/js/web/console/console-log.test.ts index 7fd9c79e5..98c8370de 100644 --- a/test/bun.js/console/console-log.test.ts +++ b/test/js/web/console/console-log.test.ts @@ -1,6 +1,6 @@ import { file, spawn } from "bun"; import { expect, it } from "bun:test"; -import { bunExe } from "bunExe"; +import { bunExe } from "harness"; it("should log to console correctly", async () => { const { stdout, stderr, exited } = spawn({ diff --git a/test/bun.js/web-crypto.test.ts b/test/js/web/crypto/web-crypto.test.ts index 250282b96..250282b96 100644 --- a/test/bun.js/web-crypto.test.ts +++ b/test/js/web/crypto/web-crypto.test.ts diff --git a/test/bun.js/text-decoder.test.js b/test/js/web/encoding/text-decoder.test.js index da0497464..abd4c2a72 100644 --- a/test/bun.js/text-decoder.test.js +++ b/test/js/web/encoding/text-decoder.test.js @@ -1,5 +1,5 @@ import { expect, it, describe } from "bun:test"; -import { gc as gcTrace, withoutAggressiveGC } from "./gc"; +import { gc as gcTrace, withoutAggressiveGC } from "harness"; const getByteLength = str => { // returns the byte length of an utf8 string diff --git a/test/bun.js/text-encoder.test.js b/test/js/web/encoding/text-encoder.test.js index a18c22618..3d271026d 100644 --- a/test/bun.js/text-encoder.test.js +++ b/test/js/web/encoding/text-encoder.test.js @@ -1,5 +1,5 @@ import { expect, it, describe } from "bun:test"; -import { gc as gcTrace, withoutAggressiveGC } from "./gc"; +import { gc as gcTrace, withoutAggressiveGC } from "harness"; const getByteLength = str => { // returns the byte length of an utf8 string diff --git a/test/bun.js/utf8-encoding-fixture.bin b/test/js/web/encoding/utf8-encoding-fixture.bin Binary files differindex 1f9ecf34f..1f9ecf34f 100644 --- a/test/bun.js/utf8-encoding-fixture.bin +++ b/test/js/web/encoding/utf8-encoding-fixture.bin diff --git a/test/bun.js/body-mixin-errors.test.ts b/test/js/web/fetch/body-mixin-errors.test.ts index f57bbc56c..f57bbc56c 100644 --- a/test/bun.js/body-mixin-errors.test.ts +++ b/test/js/web/fetch/body-mixin-errors.test.ts diff --git a/test/bun.js/body-stream.test.ts b/test/js/web/fetch/body-stream.test.ts index 1cd932ed9..1cd932ed9 100644 --- a/test/bun.js/body-stream.test.ts +++ b/test/js/web/fetch/body-stream.test.ts diff --git a/test/bun.js/fetch-gzip.test.ts b/test/js/web/fetch/fetch-gzip.test.ts index eee841375..01eedc54a 100644 --- a/test/bun.js/fetch-gzip.test.ts +++ b/test/js/web/fetch/fetch-gzip.test.ts @@ -1,7 +1,7 @@ import { concatArrayBuffers } from "bun"; import { it, describe, expect } from "bun:test"; import fs from "fs"; -import { gc, gcTick } from "./gc"; +import { gc, gcTick } from "harness"; it("fetch() with a buffered gzip response works (one chunk)", async () => { var server = Bun.serve({ diff --git a/test/js/web/fetch/fetch.js.txt b/test/js/web/fetch/fetch.js.txt new file mode 100644 index 000000000..5a9b52fcf --- /dev/null +++ b/test/js/web/fetch/fetch.js.txt @@ -0,0 +1,46 @@ +<!doctype html> +<html> +<head> + <title>Example Domain</title> + + <meta charset="utf-8" /> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <style type="text/css"> + body { + background-color: #f0f0f2; + margin: 0; + padding: 0; + font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + + } + div { + width: 600px; + margin: 5em auto; + padding: 2em; + background-color: #fdfdff; + border-radius: 0.5em; + box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02); + } + a:link, a:visited { + color: #38488f; + text-decoration: none; + } + @media (max-width: 700px) { + div { + margin: 0 auto; + width: auto; + } + } + </style> +</head> + +<body> +<div> + <h1>Example Domain</h1> + <p>This domain is for use in illustrative examples in documents. You may use this + domain in literature without prior coordination or asking for permission.</p> + <p><a href="https://www.iana.org/domains/example">More information...</a></p> +</div> +</body> +</html> diff --git a/test/bun.js/fetch.test.ts b/test/js/web/fetch/fetch.test.ts index f5f264dd7..1185dbd55 100644 --- a/test/bun.js/fetch.test.ts +++ b/test/js/web/fetch/fetch.test.ts @@ -4,7 +4,7 @@ import { chmodSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSy import { mkfifo } from "mkfifo"; import { tmpdir } from "os"; import { join } from "path"; -import { gc, withoutAggressiveGC } from "./gc"; +import { gc, withoutAggressiveGC } from "harness"; const tmp_dir = mkdtempSync(join(realpathSync(tmpdir()), "fetch.test")); diff --git a/test/bun.js/fetch_headers.test.js b/test/js/web/fetch/fetch_headers.test.js index cd2786c08..cd2786c08 100644 --- a/test/bun.js/fetch_headers.test.js +++ b/test/js/web/fetch/fetch_headers.test.js diff --git a/test/bun.js/fixture.html b/test/js/web/fetch/fixture.html index 081040506..081040506 100644 --- a/test/bun.js/fixture.html +++ b/test/js/web/fetch/fixture.html diff --git a/test/js/web/fetch/fixture.html.gz b/test/js/web/fetch/fixture.html.gz Binary files differnew file mode 100644 index 000000000..0bb85d4cb --- /dev/null +++ b/test/js/web/fetch/fixture.html.gz diff --git a/test/bun.js/FormData.test.ts b/test/js/web/html/FormData.test.ts index 25c0d5d54..9d0db4361 100644 --- a/test/bun.js/FormData.test.ts +++ b/test/js/web/html/FormData.test.ts @@ -1,7 +1,7 @@ import { afterAll, beforeAll, describe, expect, it, test } from "bun:test"; import fs, { chmodSync, unlinkSync } from "fs"; import { mkfifo } from "mkfifo"; -import { gc, withoutAggressiveGC } from "./gc"; +import { gc, withoutAggressiveGC } from "../../gc"; describe("FormData", () => { it("should be able to append a string", () => { diff --git a/test/bun.js/form-data-fixture.txt b/test/js/web/html/form-data-fixture.txt index a4d20dd78..a4d20dd78 100644 --- a/test/bun.js/form-data-fixture.txt +++ b/test/js/web/html/form-data-fixture.txt diff --git a/test/js/web/streams/bun-streams-test-fifo.sh b/test/js/web/streams/bun-streams-test-fifo.sh new file mode 100644 index 000000000..57650ba1d --- /dev/null +++ b/test/js/web/streams/bun-streams-test-fifo.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +echoerr() { echo "$@" 1>&2; } + +echoerr "bun-streams-test-fifo.sh: starting" +echo -e "$FIFO_TEST" >>${@: -1} +echoerr "bun-streams-test-fifo.sh: ending" +exit 0 diff --git a/test/js/web/streams/fetch.js.txt b/test/js/web/streams/fetch.js.txt new file mode 100644 index 000000000..5a9b52fcf --- /dev/null +++ b/test/js/web/streams/fetch.js.txt @@ -0,0 +1,46 @@ +<!doctype html> +<html> +<head> + <title>Example Domain</title> + + <meta charset="utf-8" /> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <style type="text/css"> + body { + background-color: #f0f0f2; + margin: 0; + padding: 0; + font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + + } + div { + width: 600px; + margin: 5em auto; + padding: 2em; + background-color: #fdfdff; + border-radius: 0.5em; + box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02); + } + a:link, a:visited { + color: #38488f; + text-decoration: none; + } + @media (max-width: 700px) { + div { + margin: 0 auto; + width: auto; + } + } + </style> +</head> + +<body> +<div> + <h1>Example Domain</h1> + <p>This domain is for use in illustrative examples in documents. You may use this + domain in literature without prior coordination or asking for permission.</p> + <p><a href="https://www.iana.org/domains/example">More information...</a></p> +</div> +</body> +</html> diff --git a/test/bun.js/streams.test.js b/test/js/web/streams/streams.test.js index 7ae49db40..c4af85e4f 100644 --- a/test/bun.js/streams.test.js +++ b/test/js/web/streams/streams.test.js @@ -4,7 +4,7 @@ import { mkfifo } from "mkfifo"; import { realpathSync, unlinkSync, writeFileSync } from "node:fs"; import { join } from "node:path"; import { tmpdir } from "os"; -import { gc } from "./gc"; +import { gc } from "harness"; beforeEach(() => gc()); afterEach(() => gc()); diff --git a/test/bun.js/microtask.test.js b/test/js/web/timers/microtask.test.js index f41159cfa..f41159cfa 100644 --- a/test/bun.js/microtask.test.js +++ b/test/js/web/timers/microtask.test.js diff --git a/test/bun.js/performance.test.js b/test/js/web/timers/performance.test.js index dd50c4dc6..dd50c4dc6 100644 --- a/test/bun.js/performance.test.js +++ b/test/js/web/timers/performance.test.js diff --git a/test/bun.js/setImmediate.test.js b/test/js/web/timers/setImmediate.test.js index 9cd6fa1c9..9cd6fa1c9 100644 --- a/test/bun.js/setImmediate.test.js +++ b/test/js/web/timers/setImmediate.test.js diff --git a/test/bun.js/setInterval.test.js b/test/js/web/timers/setInterval.test.js index 7b03afba5..7b03afba5 100644 --- a/test/bun.js/setInterval.test.js +++ b/test/js/web/timers/setInterval.test.js diff --git a/test/bun.js/setTimeout.test.js b/test/js/web/timers/setTimeout.test.js index 88472adc7..88472adc7 100644 --- a/test/bun.js/setTimeout.test.js +++ b/test/js/web/timers/setTimeout.test.js diff --git a/test/bun.js/url.test.ts b/test/js/web/url/url.test.ts index 19e10b262..19e10b262 100644 --- a/test/bun.js/url.test.ts +++ b/test/js/web/url/url.test.ts diff --git a/test/bun.js/atob.test.js b/test/js/web/util/atob.test.js index 4945829e1..4945829e1 100644 --- a/test/bun.js/atob.test.js +++ b/test/js/web/util/atob.test.js diff --git a/test/bun.js/web-globals.test.js b/test/js/web/web-globals.test.js index aa5756c52..b7a243190 100644 --- a/test/bun.js/web-globals.test.js +++ b/test/js/web/web-globals.test.js @@ -1,6 +1,6 @@ import { unsafe } from "bun"; import { expect, it, test } from "bun:test"; -import { withoutAggressiveGC } from "gc"; +import { withoutAggressiveGC } from "harness"; test("exists", () => { expect(typeof URL !== "undefined").toBe(true); diff --git a/test/bun.js/websocket-subprocess.ts b/test/js/web/websocket/websocket-subprocess.ts index fd25b7fd5..fd25b7fd5 100644 --- a/test/bun.js/websocket-subprocess.ts +++ b/test/js/web/websocket/websocket-subprocess.ts diff --git a/test/bun.js/websocket.test.js b/test/js/web/websocket/websocket.test.js index 61c9ec054..f0f29c1c3 100644 --- a/test/bun.js/websocket.test.js +++ b/test/js/web/websocket/websocket.test.js @@ -1,9 +1,6 @@ import { describe, it, expect } from "bun:test"; import { unsafe, spawn, readableStreamToText } from "bun"; -import { bunExe } from "bunExe"; - -import { gc } from "./gc"; -import { bunEnv } from "bunEnv"; +import { bunExe, bunEnv, gc } from "harness"; const TEST_WEBSOCKET_HOST = process.env.TEST_WEBSOCKET_HOST || "wss://ws.postman-echo.com/raw"; diff --git a/test/bun.js/html-rewriter.test.js b/test/js/workerd/html-rewriter.test.js index e33710f28..b5db3fde2 100644 --- a/test/bun.js/html-rewriter.test.js +++ b/test/js/workerd/html-rewriter.test.js @@ -1,5 +1,5 @@ import { describe, it, expect } from "bun:test"; -import { gcTick } from "./gc"; +import { gcTick } from "../gc"; var setTimeoutAsync = (fn, delay) => { return new Promise((resolve, reject) => { diff --git a/test/macro/assert.tsx b/test/macro/assert.tsx deleted file mode 100644 index 8a6e4d822..000000000 --- a/test/macro/assert.tsx +++ /dev/null @@ -1,4 +0,0 @@ -// This logs the result at build time -export function unreachable(call) { - throw new Error(call.arguments[0].toString() || "unreachable"); -} diff --git a/test/macro/fetchSync.tsx b/test/macro/fetchSync.tsx deleted file mode 100644 index 51d1ca4f5..000000000 --- a/test/macro/fetchSync.tsx +++ /dev/null @@ -1,9 +0,0 @@ -// @ts-nocheck -export async function fetchSync(ctx) { - const str = ctx.arguments[0].toString(); - - const response = await fetch(str); - const text = await response.text(); - - return <string value={text} />; -} diff --git a/test/macro/hello-fetch-macro.tsx b/test/macro/hello-fetch-macro.tsx deleted file mode 100644 index fa0de4a9d..000000000 --- a/test/macro/hello-fetch-macro.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { fetchSync } from "macro:./fetchSync.tsx"; - -const synchronousFetch = fetchSync(`https://example.com`); - -console.log(synchronousFetch); diff --git a/test/macro/loadMocks.tsx b/test/macro/loadMocks.tsx deleted file mode 100644 index 08e90dece..000000000 --- a/test/macro/loadMocks.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { unreachable } from "macro:./assert"; - -if (process.env.NODE_ENV !== "test") unreachable("This module should only be imported in tests"); - -export const mockData = { - Copilot: { - id: "Copilot", - name: "Copilot", - description: "Copilot", - icon: "https://s3.amazonaws.com/copilot-public/images/icons/Copilot.png", - color: "#00AEEF", - type: "service", - tags: ["copilot"], - categories: ["copilot"], - links: [ - { - id: "Copilot", - name: "Copilot", - url: "https://copilot.io", - description: "Copilot", - icon: "https://s3.amazonaws.com/copilot-public/images/icons/Copilot.png", - color: "#00AEEF", - type: "service", - tags: ["copilot"], - categories: ["copilot"], - }, - ], - }, -}; diff --git a/test/macro/macro.d.ts b/test/macro/macro.d.ts deleted file mode 100644 index ba02c03ed..000000000 --- a/test/macro/macro.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module "macro:*"; diff --git a/test/bun.js/mkfifo.ts b/test/mkfifo.ts index 48471cbf5..48471cbf5 100644 --- a/test/bun.js/mkfifo.ts +++ b/test/mkfifo.ts diff --git a/test/package.json b/test/package.json new file mode 100644 index 000000000..dfeabcd42 --- /dev/null +++ b/test/package.json @@ -0,0 +1,19 @@ +{ + "private": true, + "name": "test", + "type": "module", + "devDependencies": { + "bun-types": "canary" + }, + "dependencies": { + "bktree-fast": "^0.0.7", + "body-parser": "^1.20.2", + "esbuild": "^0.17.11", + "express": "^4.18.2", + "iconv-lite": "^0.6.3", + "lodash": "^4.17.21", + "react-dom": "^18.2.0", + "svelte": "^3.55.1", + "undici": "^5.20.0" + } +}
\ No newline at end of file diff --git a/test/bun.js/repro_631.test.js b/test/regression/issue/00631.test.ts index 11eba4474..691c3227c 100644 --- a/test/bun.js/repro_631.test.js +++ b/test/regression/issue/00631.test.ts @@ -1,10 +1,11 @@ import { expect, it } from "bun:test"; -import { bunExe } from "./bunExe.ts"; -import { bunEnv } from "./bunEnv.ts"; -import { mkdirSync, rmSync, writeFileSync, readFileSync } from "fs"; +import { bunExe, bunEnv } from "../../harness.js"; +import { mkdirSync, rmSync, writeFileSync, readFileSync, mkdtempSync } from "fs"; +import { tmpdir } from "os"; +import { join } from "path"; it("JSON strings escaped properly", async () => { - const testDir = import.meta.dir + "/repro_631/"; + const testDir = mkdtempSync(join(tmpdir(), "issue631-")); // Clean up from prior runs if necessary rmSync(testDir, { recursive: true, force: true }); @@ -23,6 +24,7 @@ it("JSON strings escaped properly", async () => { }); expect(exitCode).toBe(0); + console.log(testDir); const packageContents = readFileSync(testDir + "package.json", { encoding: "utf8" }); expect(packageContents).toBe(String.raw`{ "testRegex": "\\a\n\\b\\", diff --git a/test/bun.js/repro_2005.test.js b/test/regression/issue/02005.test.ts index dc0cd9a97..230be5301 100644 --- a/test/bun.js/repro_2005.test.js +++ b/test/regression/issue/02005.test.ts @@ -1,6 +1,6 @@ import { it, expect } from "bun:test"; -it("regex literal with non-Latin1 should work", () => { +it("regex literal with non-latin1 should work", () => { const text = "这是一段要替换的文字"; //Correct results: 这是一段的文字 diff --git a/test/tsconfig.json b/test/tsconfig.json new file mode 100644 index 000000000..e879cd5f5 --- /dev/null +++ b/test/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "noEmit": true, + "lib": ["ESNext"], + "module": "ESNext", + "target": "ESNext", + "moduleResolution": "nodenext", + "strict": true, + "downlevelIteration": true, + "skipLibCheck": true, + "jsx": "preserve", + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "allowJs": true, + "types": ["bun-types"], + "baseUrl": ".", + "paths": { + "harness": ["harness.ts"], + "mkfifo": ["mkfifo.ts"], + "node-harness": ["js/node/harness.ts"] + } + } +} diff --git a/tsconfig.json b/tsconfig.json index 518dca2c1..461fdb472 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,8 +16,6 @@ "bench", "examples/react-fast-refresh-test", "examples/macros", - "test/bun.js/solid-dom-fixtures", - "test/bun.js/bundled", "src/deps", "bun-webkit", // JavaScriptCore builtins use a non-standard "@" symbol to indicate a private identifier which no other tool supports |