Skip to content

Commit 7810c56

Browse files
committed
Add test to verify build when input file does not change
1 parent 643576c commit 7810c56

File tree

4 files changed

+1103
-0
lines changed

4 files changed

+1103
-0
lines changed

Diff for: src/testRunner/unittests/tsbuild/outFile.ts

+16
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,22 @@ namespace ts {
171171
]
172172
});
173173

174+
verifyTscWithEdits({
175+
scenario: "outFile",
176+
subScenario: "when input file text does not change but its modified time changes",
177+
fs: () => outFileFs,
178+
commandLineArgs: ["--b", "/src/third", "--verbose"],
179+
edits: [
180+
{
181+
subScenario: "upstream project changes without changing file text",
182+
modifyFs: fs => {
183+
const time = new Date(fs.time());
184+
fs.utimesSync("/src/first/first_PART1.ts", time, time);
185+
},
186+
},
187+
]
188+
});
189+
174190
verifyTscCompileLike(testTscCompileLike, {
175191
scenario: "outFile",
176192
subScenario: "builds till project specified",

Diff for: src/testRunner/unittests/tsbuild/sample.ts

+16
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,22 @@ namespace ts {
138138
]
139139
});
140140

141+
verifyTscWithEdits({
142+
scenario: "sample1",
143+
subScenario: "when input file text does not change but its modified time changes",
144+
fs: () => projFs,
145+
commandLineArgs: ["--b", "/src/tests", "--verbose"],
146+
edits: [
147+
{
148+
subScenario: "upstream project changes without changing file text",
149+
modifyFs: fs => {
150+
const time = new Date(fs.time());
151+
fs.utimesSync("/src/core/index.ts", time, time);
152+
},
153+
},
154+
]
155+
});
156+
141157
verifyTsc({
142158
scenario: "sample1",
143159
subScenario: "indicates that it would skip builds during a dry build",

0 commit comments

Comments
 (0)