-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
assertions.spec.ts
50 lines (36 loc) · 1.58 KB
/
assertions.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { Fixture, normalizeCommandOutput, normalizeEnvironment } from "@lerna/e2e-utils";
expect.addSnapshotSerializer({
serialize(str: string) {
return normalizeCommandOutput(normalizeEnvironment(str));
},
test(val: string) {
return val != null && typeof val === "string";
},
});
describe("lerna-run-nx-include-dependencies-without-target-defaults", () => {
const fixtureRootPath = process.env.FIXTURE_ROOT_PATH;
let fixture: Fixture;
beforeAll(() => {
if (!fixtureRootPath) {
throw new Error("FIXTURE_ROOT_PATH environment variable is not set");
}
fixture = Fixture.fromExisting(process.env.E2E_ROOT, fixtureRootPath);
});
afterAll(() => fixture.destroy());
it("should exclude dependencies by default", async () => {
const output = await fixture.readOutput("print-name-package-3");
expect(output).toMatchInlineSnapshot(`
lerna notice cli v999.9.9-e2e.0
lerna verb packageConfigs Explicit "packages" configuration found in lerna.json. Resolving packages using the configured glob(s): ["packages/*"]
lerna verb rootPath /tmp/lerna-e2e/lerna-run-nx-include-dependencies-without-target-defaults/lerna-workspace
lerna notice filter including "package-X"
lerna info filter [ 'package-X' ]
lerna verb run Nx target configuration was not found. Task dependencies will not be automatically included.
> package-X:print-name
> [email protected] print-name
> echo test-package-X
test-package-X
Lerna (powered by Nx) Successfully ran target print-name for project package-X
`);
});
});