diff options
| author | 2023-05-10 17:22:01 +0300 | |
|---|---|---|
| committer | 2023-05-10 17:22:01 +0300 | |
| commit | 5fd838b9e47f58756a7798bc0997286d32f924a9 (patch) | |
| tree | 5d7340c9cbe53a3925c961bb864a4a3b1e7ee724 /test/cli/install/bun-add.test.ts | |
| parent | 5b2c3fe4400befb69de3dd32b20634cd4b8bc70b (diff) | |
| download | bun-5fd838b9e47f58756a7798bc0997286d32f924a9.tar.gz bun-5fd838b9e47f58756a7798bc0997286d32f924a9.tar.zst bun-5fd838b9e47f58756a7798bc0997286d32f924a9.zip | |
`bun add` from root folder when call within workspaces (#2841)
- ignore invalid `package.json` from parent directories
- `echo` new lines from `make` targets correctly
Diffstat (limited to 'test/cli/install/bun-add.test.ts')
| -rw-r--r-- | test/cli/install/bun-add.test.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/cli/install/bun-add.test.ts b/test/cli/install/bun-add.test.ts index b14afa918..95a201295 100644 --- a/test/cli/install/bun-add.test.ts +++ b/test/cli/install/bun-add.test.ts @@ -1390,20 +1390,21 @@ it("should add dependencies to workspaces directly", async () => { const out = await new Response(stdout).text(); expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([ "", - ` installed foo@${add_path}`, + ` installed foo@${relative(package_dir, add_dir)}`, "", "", " 1 packages installed", ]); expect(await exited).toBe(0); - expect(await readdirSorted(join(package_dir))).toEqual(["bunfig.toml", "moo", "package.json"]); - expect(await file(join(package_dir, "package.json")).text()).toEqual(bar_package); - expect(await readdirSorted(join(package_dir, "moo"))).toEqual([ + expect(await readdirSorted(join(package_dir))).toEqual([ "bun.lockb", "bunfig.toml", + "moo", "node_modules", "package.json", ]); + expect(await file(join(package_dir, "package.json")).text()).toEqual(bar_package); + expect(await readdirSorted(join(package_dir, "moo"))).toEqual(["bunfig.toml", "package.json"]); expect(await file(join(package_dir, "moo", "package.json")).json()).toEqual({ name: "moo", version: "0.3.0", @@ -1411,7 +1412,7 @@ it("should add dependencies to workspaces directly", async () => { foo: `file:${add_path}`, }, }); - expect(await readdirSorted(join(package_dir, "moo", "node_modules"))).toEqual([".cache", "foo"]); - expect(await readdirSorted(join(package_dir, "moo", "node_modules", "foo"))).toEqual(["package.json"]); - expect(await file(join(package_dir, "moo", "node_modules", "foo", "package.json")).text()).toEqual(foo_package); + expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "foo"]); + expect(await readdirSorted(join(package_dir, "node_modules", "foo"))).toEqual(["package.json"]); + expect(await file(join(package_dir, "node_modules", "foo", "package.json")).text()).toEqual(foo_package); }); |
