Skip to content

Commit 70fa29b

Browse files
committed
Add graph ordering tests
1 parent a7fcbcd commit 70fa29b

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/compiler/tsbuild.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ namespace ts {
650650
}
651651
}
652652

653-
// TODO Accept parsedCommandLine instead?
654653
function buildSingleProject(proj: ResolvedConfigFileName): BuildResultFlags {
655654
if (context.options.dry) {
656655
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Would_build_project_0, proj));

src/harness/unittests/tsbuild.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,15 @@ namespace ts {
228228
});
229229

230230
it("orders the graph correctly - multiple parts of the same graph in various orders", () => {
231-
// TODO add cases here
231+
checkGraphOrdering(["A"], ["A", "B", "C", "D", "E"]);
232+
checkGraphOrdering(["A", "C", "D"], ["A", "B", "C", "D", "E"]);
233+
checkGraphOrdering(["D", "C", "A"], ["A", "B", "C", "D", "E"]);
234+
});
235+
236+
it("orders the graph correctly - other orderings", () => {
237+
checkGraphOrdering(["F"], ["F", "E"]);
238+
checkGraphOrdering(["E"], ["E"]);
239+
checkGraphOrdering(["F", "C", "A"], ["A", "B", "C", "D", "E", "F"]);
232240
});
233241

234242
function checkGraphOrdering(rootNames: string[], expectedBuildSet: string[]) {

0 commit comments

Comments
 (0)