diff options
author | 2023-02-10 06:35:58 +0200 | |
---|---|---|
committer | 2023-02-09 20:35:58 -0800 | |
commit | 6fd7c1921e6fcfc4fcb95b2c9ac612de5c288932 (patch) | |
tree | 9e3dee670f37767efd696f94313973bc895cc7cd /test/bun.js/install/bun-add.test.ts | |
parent | 119120d21ccc3d2424a607f0637b89a5aae871ec (diff) | |
download | bun-6fd7c1921e6fcfc4fcb95b2c9ac612de5c288932.tar.gz bun-6fd7c1921e6fcfc4fcb95b2c9ac612de5c288932.tar.zst bun-6fd7c1921e6fcfc4fcb95b2c9ac612de5c288932.zip |
[install] fix flaky tests (#2032)
Diffstat (limited to 'test/bun.js/install/bun-add.test.ts')
-rw-r--r-- | test/bun.js/install/bun-add.test.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/bun.js/install/bun-add.test.ts b/test/bun.js/install/bun-add.test.ts index 922d8c0b6..22974a82c 100644 --- a/test/bun.js/install/bun-add.test.ts +++ b/test/bun.js/install/bun-add.test.ts @@ -186,7 +186,7 @@ it("should handle semver-like names", async () => { expect(stdout).toBeDefined(); expect(await new Response(stdout).text()).toBe(""); expect(await exited).toBe(1); - expect(urls).toEqual([`${root_url}/1.2.3`]); + expect(urls.sort()).toEqual([`${root_url}/1.2.3`]); expect(requested).toBe(1); try { await access(join(package_dir, "bun.lockb")); @@ -229,7 +229,7 @@ it("should handle @scoped names", async () => { expect(stdout).toBeDefined(); expect(await new Response(stdout).text()).toBe(""); expect(await exited).toBe(1); - expect(urls).toEqual([`${root_url}/@bar/baz`]); + expect(urls.sort()).toEqual([`${root_url}/@bar/baz`]); expect(requested).toBe(1); try { await access(join(package_dir, "bun.lockb")); @@ -279,7 +279,7 @@ it("should add dependency with specified semver", async () => { " 1 packages installed", ]); expect(await exited).toBe(0); - expect(urls).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); + expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); expect(requested).toBe(2); expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".bin", ".cache", "baz"]); expect(await readdirSorted(join(package_dir, "node_modules", ".bin"))).toEqual(["baz-run"]); @@ -352,7 +352,7 @@ it("should add dependency alongside workspaces", async () => { " 2 packages installed", ]); expect(await exited).toBe(0); - expect(urls).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); + expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); expect(requested).toBe(2); expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".bin", ".cache", "bar", "baz"]); expect(await readdirSorted(join(package_dir, "node_modules", ".bin"))).toEqual(["baz-run"]); @@ -417,7 +417,7 @@ it("should add aliased dependency (npm)", async () => { " 1 packages installed", ]); expect(await exited).toBe(0); - expect(urls).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); + expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); expect(requested).toBe(2); expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".bin", ".cache", "bar"]); expect(await readdirSorted(join(package_dir, "node_modules", ".bin"))).toEqual(["baz-run"]); @@ -472,7 +472,7 @@ it("should add aliased dependency (GitHub)", async () => { " 1 packages installed", ]); expect(await exited).toBe(0); - expect(urls).toEqual([]); + expect(urls.sort()).toEqual([]); expect(requested).toBe(0); expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".bin", ".cache", "uglify"]); expect(await readdirSorted(join(package_dir, "node_modules", ".bin"))).toEqual(["uglifyjs"]); @@ -550,7 +550,7 @@ it("should let you add the same package twice", async () => { " 1 packages installed", ]); expect(await exited1).toBe(0); - expect(urls).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); + expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); expect(requested).toBe(2); expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "baz"]); expect(await file(join(package_dir, "node_modules", "baz", "package.json")).json()).toEqual({ @@ -589,7 +589,7 @@ it("should let you add the same package twice", async () => { const out2 = await new Response(stdout2).text(); expect(out2.replace(/\[[0-9\.]+m?s\]/, "[]").split(/\r?\n/)).toEqual(["", " installed baz@0.0.3", "", "[] done", ""]); expect(await exited2).toBe(0); - expect(urls).toEqual([`${root_url}/baz`]); + expect(urls.sort()).toEqual([`${root_url}/baz`]); expect(requested).toBe(3); expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "baz"]); expect(await file(join(package_dir, "node_modules", "baz", "package.json")).json()).toEqual({ @@ -651,7 +651,7 @@ it("should install version tagged with `latest` by default", async () => { " 1 packages installed", ]); expect(await exited1).toBe(0); - expect(urls).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); + expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); expect(requested).toBe(2); expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "baz"]); expect(await file(join(package_dir, "node_modules", "baz", "package.json")).json()).toEqual({ @@ -695,7 +695,7 @@ it("should install version tagged with `latest` by default", async () => { " 1 packages installed", ]); expect(await exited2).toBe(0); - expect(urls).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); + expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]); expect(requested).toBe(4); expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "baz"]); expect(await file(join(package_dir, "node_modules", "baz", "package.json")).json()).toEqual({ |