Skip to content

Commit c4ddbf1

Browse files
committed
test(project): Build dependencies in application test of ProjectBuilder
1 parent 172f73e commit c4ddbf1

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

packages/project/test/lib/build/ProjectBuilder.integration.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,34 @@ test.serial("Build application.a project multiple times", async (t) => {
123123
await projectBuilder.build({destPath, cleanDest: true});
124124

125125
t.is(projectBuilder._buildProject.callCount, 0, "No projects built in build #4");
126+
127+
// #5 build (with cache, no changes, with dependencies)
128+
projectBuilder = await fixtureTester.createProjectBuilder();
129+
await projectBuilder.build({destPath, cleanDest: true, dependencyIncludes: {includeAllDependencies: true}});
130+
131+
t.is(projectBuilder._buildProject.callCount, 4, "Only dependency projects built in build #5");
132+
t.is(
133+
projectBuilder._buildProject.getCall(0).args[0].getProject().getName(),
134+
"library.d",
135+
);
136+
t.is(
137+
projectBuilder._buildProject.getCall(1).args[0].getProject().getName(),
138+
"library.a",
139+
);
140+
t.is(
141+
projectBuilder._buildProject.getCall(2).args[0].getProject().getName(),
142+
"library.b",
143+
);
144+
t.is(
145+
projectBuilder._buildProject.getCall(3).args[0].getProject().getName(),
146+
"library.c",
147+
);
148+
149+
// #6 build (with cache, no changes)
150+
projectBuilder = await fixtureTester.createProjectBuilder();
151+
await projectBuilder.build({destPath, cleanDest: true});
152+
153+
t.is(projectBuilder._buildProject.callCount, 0, "No projects built in build #6");
126154
});
127155

128156
test.serial("Build library.d project multiple times", async (t) => {
@@ -178,7 +206,7 @@ test.serial("Build library.d project multiple times", async (t) => {
178206
buildStatusEventArgs = t.context.projectBuildStatusEventStub.args.map((args) => args[0]);
179207
t.deepEqual(
180208
buildStatusEventArgs.filter(({status}) => status === "task-skip"), [],
181-
"No 'task-skip' status in build #3"
209+
"No 'task-skip' status in build #3" // TODO: Is this correct?
182210
);
183211

184212
// Check whether the changed file is in the destPath

0 commit comments

Comments
 (0)