Skip to content

Commit

Permalink
fix(add): Never pass filter options to nested bootstrap
Browse files Browse the repository at this point in the history
Fixes #1989
  • Loading branch information
evocateur committed May 14, 2019
1 parent ccaf987 commit 9a5a29c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
27 changes: 27 additions & 0 deletions commands/add/__tests__/add-command.test.js
Expand Up @@ -239,6 +239,33 @@ describe("AddCommand", () => {
);
});

it("should not pass filter options to bootstrap", async () => {
const testDir = await initFixture("existing");

await lernaAdd(testDir)(
"@test/package-2",
"--scope=@test/package-1",
"--ignore=@test/package-3",
"--no-private",
"--since=deadbeef",
"--include-filtered-dependents",
"--include-filtered-dependencies"
);
const [pkg1] = await getPackages(testDir);

expect(pkg1).toDependOn("@test/package-2");
expect(bootstrap).toHaveBeenLastCalledWith(
expect.objectContaining({
scope: undefined,
ignore: undefined,
private: undefined,
since: undefined,
includeFilteredDependents: undefined,
includeFilteredDependencies: undefined,
})
);
});

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

Expand Down
7 changes: 7 additions & 0 deletions commands/add/index.js
Expand Up @@ -100,6 +100,13 @@ class AddCommand extends Command {
cwd: this.project.rootPath,
// silence initial cli version logging, etc
composed: "add",
// NEVER pass filter-options, it is very bad
scope: undefined,
ignore: undefined,
private: undefined,
since: undefined,
includeFilteredDependents: undefined,
includeFilteredDependencies: undefined,
});

return bootstrap(argv);
Expand Down

0 comments on commit 9a5a29c

Please sign in to comment.