Skip to content

Commit a72fe5d

Browse files
committed
Add a testcase
1 parent bb29a10 commit a72fe5d

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/testRunner/unittests/tsbuild.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,23 @@ namespace ts {
259259
});
260260
});
261261
});
262+
263+
describe("tsbuild - downstream prepend projects always get rebuilt", () => {
264+
const fs = outFileFs.shadow();
265+
const host = new fakes.CompilerHost(fs);
266+
const builder = createSolutionBuilder(host, buildHost, ["/src/third"], { dry: false, force: false, verbose: false });
267+
clearDiagnostics();
268+
builder.buildAllProjects();
269+
assertDiagnosticMessages(/*none*/);
270+
assert.equal(fs.statSync("src/third/thirdjs/output/third-output.js").mtimeMs, time(), "First build timestamp is correct");
271+
tick();
272+
replaceText(fs, "src/first/first_PART1.ts", "Hello", "Hola");
273+
tick();
274+
builder.resetBuildContext();
275+
builder.buildAllProjects();
276+
assertDiagnosticMessages(/*none*/);
277+
assert.equal(fs.statSync("src/third/thirdjs/output/third-output.js").mtimeMs, time(), "Second build timestamp is correct");
278+
});
262279
}
263280

264281
describe("tsbuild - graph-ordering", () => {

tests/projects/outfile-concat/first/tsconfig.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
"declaration": true,
1010
"outFile": "./bin/first-output.js"
1111
},
12+
"files": [
13+
"first_PART1.ts",
14+
"first_part2.ts",
15+
"first_part3.ts"
16+
],
1217
"references": [
1318
]
1419
}

tests/projects/outfile-concat/third/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"declaration": true,
1010
"outFile": "./thirdjs/output/third-output.js"
1111
},
12+
"files": [
13+
"third_part1.ts"
14+
],
1215
"references": [
1316
{ "path": "../first", "prepend": true },
1417
{ "path": "../second", "prepend": true },

0 commit comments

Comments
 (0)