Skip to content

Commit 09747e5

Browse files
committed
Add test for current --incremental behaviour
1 parent 2932421 commit 09747e5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/testRunner/unittests/config/commandLineParsing.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,23 @@ namespace ts {
365365
}
366366
});
367367
});
368+
369+
it("parse --incremental", () => {
370+
// --lib es6 0.ts
371+
assertParseResult(["--incremental", "0.ts"],
372+
{
373+
errors: [{
374+
messageText: "Option 'incremental' can only be specified in 'tsconfig.json' file.",
375+
category: Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file.category,
376+
code: Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file.code,
377+
file: undefined,
378+
start: undefined,
379+
length: undefined,
380+
}],
381+
fileNames: ["0.ts"],
382+
options: {}
383+
});
384+
});
368385
});
369386

370387
describe("unittests:: config:: commandLineParsing:: parseBuildOptions", () => {
@@ -456,6 +473,23 @@ namespace ts {
456473
});
457474
});
458475

476+
it("parse build with --incremental ", () => {
477+
// --lib es6 0.ts
478+
assertParseResult(["--incremental", "tests"],
479+
{
480+
errors: [{
481+
messageText: "Unknown build option '--incremental'.",
482+
category: Diagnostics.Unknown_build_option_0.category,
483+
code: Diagnostics.Unknown_build_option_0.code,
484+
file: undefined,
485+
start: undefined,
486+
length: undefined,
487+
}],
488+
projects: ["tests"],
489+
buildOptions: { }
490+
});
491+
});
492+
459493
describe("Combining options that make no sense together", () => {
460494
function verifyInvalidCombination(flag1: keyof BuildOptions, flag2: keyof BuildOptions) {
461495
it(`--${flag1} and --${flag2} together is invalid`, () => {

0 commit comments

Comments
 (0)