Skip to content

Commit 305303c

Browse files
committed
Fix test case for project reference with composite not true
1 parent 60801a2 commit 305303c

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/testRunner/unittests/projectReferences.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ namespace ts {
147147
},
148148
"/reference": {
149149
files: { "/secondary/b.ts": moduleImporting("../primary/a") },
150-
references: ["../primary"]
150+
references: ["../primary"],
151+
config: {
152+
files: ["b.ts"]
153+
}
151154
}
152155
};
153156
testProjectReferences(spec, "/reference/tsconfig.json", program => {
@@ -156,6 +159,26 @@ namespace ts {
156159
});
157160
});
158161

162+
it("does not error when the referenced project doesn't have composite:true if its a container project", () => {
163+
const spec: TestSpecification = {
164+
"/primary": {
165+
files: { "/primary/a.ts": emptyModule },
166+
references: [],
167+
options: {
168+
composite: false
169+
}
170+
},
171+
"/reference": {
172+
files: { "/secondary/b.ts": moduleImporting("../primary/a") },
173+
references: ["../primary"],
174+
}
175+
};
176+
testProjectReferences(spec, "/reference/tsconfig.json", program => {
177+
const errs = program.getOptionsDiagnostics();
178+
assertNoErrors("Reports an error about 'composite' not being set", errs);
179+
});
180+
});
181+
159182
it("errors when the file list is not exhaustive", () => {
160183
const spec: TestSpecification = {
161184
"/primary": {

0 commit comments

Comments
 (0)