diff options
author | 2022-12-26 10:25:59 +0200 | |
---|---|---|
committer | 2022-12-26 00:25:59 -0800 | |
commit | d94b96d9f440d3aeef4402aec9f3788bca2972d0 (patch) | |
tree | 8002c06135f5b247b210b85ef2602cc794f097fd /test/bun.js/bun-install.test.ts | |
parent | 74251fbf5e011191721c96ea520f29a7cc4ea94a (diff) | |
download | bun-d94b96d9f440d3aeef4402aec9f3788bca2972d0.tar.gz bun-d94b96d9f440d3aeef4402aec9f3788bca2972d0.tar.zst bun-d94b96d9f440d3aeef4402aec9f3788bca2972d0.zip |
[install] use specified base URL as default fallback within scopes (#1665)
Diffstat (limited to 'test/bun.js/bun-install.test.ts')
-rw-r--r-- | test/bun.js/bun-install.test.ts | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/test/bun.js/bun-install.test.ts b/test/bun.js/bun-install.test.ts deleted file mode 100644 index 1bc4655eb..000000000 --- a/test/bun.js/bun-install.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { spawn, spawnSync } from "bun"; -import { describe, expect, it, test } from "bun:test"; -import { bunExe } from "bunExe"; - -test("bun install", async () => { - const urls = []; - const server = Bun.serve({ - async fetch(request) { - try { - expect(request.method).toBe("GET"); - expect(request.headers.get("accept")).toBe("application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"); - expect(await request.text()).toBe(""); - urls.push(request.url); - return new Response("bar", { status: 404 }); - } finally { - server.stop(); - } - }, - port: 54321, - }); - const { stdout, stderr, exited } = spawn({ - cmd: [bunExe(), "install", "foo", "--config", import.meta.dir + "/bun-install.toml"], - stdout: null, - stdin: "pipe", - stderr: "pipe", - env: { - ...process.env, - BUN_DEBUG_QUIET_LOGS: "1", - }, - }); - expect(stdout).toBeDefined(); - expect(stderr).toBeDefined(); - expect(await new Response(stdout).text()).toBe(""); - var err = await new Response(stderr).text(); - expect(err.split(/\n/)).toContain('error: package "foo" not found localhost/foo 404'); - expect(urls).toContain("http://localhost:54321/foo"); - expect(await exited).toBe(1); -}); |