Skip to content

Commit

Permalink
fix(add): Do not scope chained bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
evocateur committed Jan 10, 2019
1 parent 27516b9 commit d9d4bc4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
25 changes: 0 additions & 25 deletions commands/add/__tests__/add-command.test.js
Expand Up @@ -234,36 +234,11 @@ describe("AddCommand", () => {
expect.objectContaining({
args: [],
cwd: testDir,
scope: ["@test/package-2", "package-3", "package-4"],
composed: "add",
})
);
});

it("should only bootstrap scoped packages", async () => {
const testDir = await initFixture("basic");

await lernaAdd(testDir)("tiny-tarball", "--scope", "@test/package-2", "--scope", "package-3");

expect(bootstrap).toHaveBeenLastCalledWith(
expect.objectContaining({
scope: ["@test/package-2", "package-3"],
})
);
});

it("should not bootstrap ignored packages", async () => {
const testDir = await initFixture("basic");

await lernaAdd(testDir)("@test/package-1", "--ignore", "@test/package-2");

expect(bootstrap).toHaveBeenLastCalledWith(
expect.objectContaining({
scope: ["package-3", "package-4"],
})
);
});

it("should not bootstrap unchanged packages", async () => {
const testDir = await initFixture("unchanged");

Expand Down
1 change: 0 additions & 1 deletion commands/add/index.js
Expand Up @@ -98,7 +98,6 @@ class AddCommand extends Command {
const argv = Object.assign({}, this.options, {
args: [],
cwd: this.project.rootPath,
scope: this.packagesToChange.map(pkg => pkg.name),
// silence initial cli version logging, etc
composed: "add",
});
Expand Down
5 changes: 2 additions & 3 deletions integration/lerna-add.test.js
Expand Up @@ -20,10 +20,9 @@ describe("lerna add", () => {
lerna notice cli __TEST_VERSION__
lerna info ci enabled
lerna info Adding @test/package-1 in 3 packages
lerna info filter [ '@test/package-2', 'package-3', 'package-4' ]
lerna info Bootstrapping 3 packages
lerna info Bootstrapping 4 packages
lerna info Symlinking packages and binaries
lerna success Bootstrapped 3 packages
lerna success Bootstrapped 4 packages
`);

const filePaths = await globby("packages/*/package.json", { cwd });
Expand Down

0 comments on commit d9d4bc4

Please sign in to comment.