Skip to content

Commit

Permalink
chore(run): add e2e test for multi-script, single package case
Browse files Browse the repository at this point in the history
  • Loading branch information
fahslaj committed Mar 25, 2023
1 parent 2cc7c17 commit 166b4a5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions e2e/run/task-runner/src/multiple-targets/assertions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,44 @@ describe("lerna-run-nx-multiple-targets", () => {
`);
});

it("should run multiple comma-delimited targets concurrently for a single package", async () => {
const output = await fixture.readOutput("multiple-targets-single-package");
expect(output).toMatchInlineSnapshot(`
lerna notice cli v999.9.9-e2e.0
lerna notice filter including "package-X"
lerna info filter [ 'package-X' ]
> Lerna (powered by Nx) Running targets XXXXXXXXXX, XXXXXXXXXX for project package-X:
- package-X
> package-X:XXXXXXXXXX
> package-X@0.0.0 XXXXXXXXXX
> echo test-package-X
test-package-X
> package-X:XXXXXXXXXX
> package-X@0.0.0 XXXXXXXXXX
> echo test-package-X
test-package-X
> Lerna (powered by Nx) Successfully ran targets XXXXXXXXXX, XXXXXXXXXX for project package-X
`);
});
});
1 change: 1 addition & 0 deletions e2e/run/task-runner/src/multiple-targets/exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ initializeFixture $DIR

# Run the relevant task runner commands and write stdout and stderr to a named file in each case (for later assertions)
npx lerna run print-name,print-name-again > $OUTPUTS/multiple-targets.txt 2>&1
npx lerna run print-name,print-name-again --scope="package-3" > $OUTPUTS/multiple-targets-single-package.txt 2>&1

# Run the assertions
runAssertions $DIR $E2E_ROOT $FIXTURE_ROOT_PATH $UPDATE_SNAPSHOTS

0 comments on commit 166b4a5

Please sign in to comment.