@@ -497,96 +497,65 @@ console.log(a);`,
497
497
} ,
498
498
} ;
499
499
}
500
- verifyTsc ( {
501
- scenario : "incremental" ,
502
- subScenario : "different options" ,
503
- fs : ( ) => fs ( { composite : true } ) ,
504
- commandLineArgs : [ "--p" , "/src/project" ] ,
505
- edits : [
506
- withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
507
- noChangeWithSubscenario ( "should re-emit only js so they dont contain sourcemap" ) ,
508
- withOptionChangeAndDiscrepancyExplanation ( "with declaration should not emit anything" , "--declaration" ) ,
509
- noChangeRun ,
510
- withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
511
- noChangeWithSubscenario ( "should re-emit only dts so they dont contain sourcemap" ) ,
512
- withOptionChangeAndDiscrepancyExplanation ( "with emitDeclarationOnly should not emit anything" , "--emitDeclarationOnly" ) ,
513
- noChangeRun ,
514
- localChange ( ) ,
515
- withOptionChangeAndDiscrepancyExplanation ( "with declaration should not emit anything" , "--declaration" ) ,
516
- withOptionChange ( "with inlineSourceMap" , "--inlineSourceMap" ) ,
517
- withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
518
- enableDeclarationMap ( ) ,
519
- withOptionChange ( "with sourceMap should not emit d.ts" , "--sourceMap" ) ,
520
- ] ,
521
- baselinePrograms : true ,
522
- } ) ;
523
- verifyTsc ( {
524
- scenario : "incremental" ,
525
- subScenario : "different options with outFile" ,
526
- fs : ( ) => fs ( { composite : true , outFile : "../outFile.js" , module : ts . ModuleKind . AMD } ) ,
527
- commandLineArgs : [ "--p" , "/src/project" ] ,
528
- edits : [
529
- withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
530
- noChangeWithSubscenario ( "should re-emit only js so they dont contain sourcemap" ) ,
531
- withOptionChangeAndDiscrepancyExplanation ( "with declaration should not emit anything" , "--declaration" ) ,
532
- noChangeRun ,
533
- withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
534
- noChangeWithSubscenario ( "should re-emit only dts so they dont contain sourcemap" ) ,
535
- withEmitDeclarationOnlyChangeAndDiscrepancyExplanation ( "with emitDeclarationOnly should not emit anything" ) ,
536
- noChangeRun ,
537
- localChange ( ) ,
538
- withOptionChangeAndDiscrepancyExplanation ( "with declaration should not emit anything" , "--declaration" ) ,
539
- withOptionChange ( "with inlineSourceMap" , "--inlineSourceMap" ) ,
540
- withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
541
- enableDeclarationMap ( ) ,
542
- withOptionChange ( "with sourceMap should not emit d.ts" , "--sourceMap" ) ,
543
- ] ,
544
- baselinePrograms : true ,
545
- } ) ;
546
- verifyTsc ( {
547
- scenario : "incremental" ,
548
- subScenario : "different options with incremental" ,
549
- fs : ( ) => fs ( { incremental : true } ) ,
550
- commandLineArgs : [ "--p" , "/src/project" ] ,
551
- edits : [
552
- withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
553
- withOptionChange ( "should re-emit only js so they dont contain sourcemap" ) ,
554
- withOptionChange ( "with declaration, emit Dts and should not emit js" , "--declaration" ) ,
555
- withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
556
- nochangeWithIncrementalDeclarationFromBeforeExplaination ( ) ,
557
- localChange ( ) ,
558
- withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
559
- nochangeWithIncrementalDeclarationFromBeforeExplaination ( ) ,
560
- withOptionChange ( "with inlineSourceMap" , "--inlineSourceMap" ) ,
561
- withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
562
- noChangeWithSubscenario ( "emit js files" ) ,
563
- withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
564
- withOptionChange ( "with declaration and declarationMap, should not re-emit" , "--declaration" , "--declarationMap" ) ,
565
- ] ,
566
- baselinePrograms : true ,
567
- } ) ;
568
- verifyTsc ( {
569
- scenario : "incremental" ,
570
- subScenario : "different options with incremental with outFile" ,
571
- fs : ( ) => fs ( { incremental : true , outFile : "../outFile.js" , module : ts . ModuleKind . AMD } ) ,
572
- commandLineArgs : [ "--p" , "/src/project" ] ,
573
- edits : [
574
- withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
575
- noChangeWithSubscenario ( "should re-emit only js so they dont contain sourcemap" ) ,
576
- withOptionChange ( "with declaration, emit Dts and should not emit js" , "--declaration" ) ,
577
- withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
578
- nochangeWithIncrementalOutDeclarationFromBeforeExplaination ( ) ,
579
- localChange ( ) ,
580
- withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
581
- nochangeWithIncrementalOutDeclarationFromBeforeExplaination ( ) ,
582
- withOptionChange ( "with inlineSourceMap" , "--inlineSourceMap" ) ,
583
- withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
584
- noChangeWithSubscenario ( "emit js files" ) ,
585
- withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
586
- withOptionChange ( "with declaration and declarationMap, should not re-emit" , "--declaration" , "--declarationMap" ) ,
587
- ] ,
588
- baselinePrograms : true ,
589
- } ) ;
500
+ function verify ( options : ts . CompilerOptions ) {
501
+ function scenarioName ( text : string ) {
502
+ return `${ options . outFile ? "outFile" : "multiFile" } /${ text } ` ;
503
+ }
504
+ verifyTsc ( {
505
+ scenario : "incremental" ,
506
+ subScenario : scenarioName ( "different options" ) ,
507
+ fs : ( ) => fs ( { composite : true , ...options } ) ,
508
+ commandLineArgs : [ "--p" , "/src/project" ] ,
509
+ edits : [
510
+ withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
511
+ noChangeWithSubscenario ( "should re-emit only js so they dont contain sourcemap" ) ,
512
+ withOptionChangeAndDiscrepancyExplanation ( "with declaration should not emit anything" , "--declaration" ) ,
513
+ noChangeRun ,
514
+ withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
515
+ noChangeWithSubscenario ( "should re-emit only dts so they dont contain sourcemap" ) ,
516
+ ! options . outFile ?
517
+ withOptionChangeAndDiscrepancyExplanation ( "with emitDeclarationOnly should not emit anything" , "--emitDeclarationOnly" ) :
518
+ withEmitDeclarationOnlyChangeAndDiscrepancyExplanation ( "with emitDeclarationOnly should not emit anything" ) ,
519
+ noChangeRun ,
520
+ localChange ( ) ,
521
+ withOptionChangeAndDiscrepancyExplanation ( "with declaration should not emit anything" , "--declaration" ) ,
522
+ withOptionChange ( "with inlineSourceMap" , "--inlineSourceMap" ) ,
523
+ withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
524
+ enableDeclarationMap ( ) ,
525
+ withOptionChange ( "with sourceMap should not emit d.ts" , "--sourceMap" ) ,
526
+ ] ,
527
+ baselinePrograms : true ,
528
+ } ) ;
529
+ verifyTsc ( {
530
+ scenario : "incremental" ,
531
+ subScenario : scenarioName ( "different options with incremental" ) ,
532
+ fs : ( ) => fs ( { incremental : true , ...options } ) ,
533
+ commandLineArgs : [ "--p" , "/src/project" ] ,
534
+ edits : [
535
+ withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
536
+ noChangeWithSubscenario ( "should re-emit only js so they dont contain sourcemap" ) ,
537
+ withOptionChange ( "with declaration, emit Dts and should not emit js" , "--declaration" ) ,
538
+ withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
539
+ ! options . outFile ?
540
+ nochangeWithIncrementalDeclarationFromBeforeExplaination ( ) :
541
+ nochangeWithIncrementalOutDeclarationFromBeforeExplaination ( ) ,
542
+ localChange ( ) ,
543
+ withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
544
+ ! options . outFile ?
545
+ nochangeWithIncrementalDeclarationFromBeforeExplaination ( ) :
546
+ nochangeWithIncrementalOutDeclarationFromBeforeExplaination ( ) ,
547
+ withOptionChange ( "with inlineSourceMap" , "--inlineSourceMap" ) ,
548
+ withOptionChange ( "with sourceMap" , "--sourceMap" ) ,
549
+ noChangeWithSubscenario ( "emit js files" ) ,
550
+ withOptionChange ( "with declaration and declarationMap" , "--declaration" , "--declarationMap" ) ,
551
+ withOptionChange ( "with declaration and declarationMap, should not re-emit" , "--declaration" , "--declarationMap" ) ,
552
+ ] ,
553
+ baselinePrograms : true ,
554
+ } ) ;
555
+ }
556
+
557
+ verify ( { } ) ;
558
+ verify ( { outFile : "../outFile.js" , module : ts . ModuleKind . AMD } ) ;
590
559
} ) ;
591
560
592
561
verifyTsc ( {
0 commit comments