Skip to content

Commit 7b1a848

Browse files
committed
Fix some of the baseline to use correct API
1 parent 5fe2ff2 commit 7b1a848

File tree

61 files changed

+336
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+336
-196
lines changed

src/testRunner/unittests/config/configurationExtension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ describe("unittests:: config:: configurationExtension", () => {
317317
baseline.push("CompilerOptions::");
318318
baseline.push(jsonToReadableText(parsed.options));
319319
baseline.push("FileNames::");
320-
baseline.push(parsed.fileNames.join());
320+
baseline.push(...parsed.fileNames);
321321
},
322322
})),
323323
skipFs: true,

src/testRunner/unittests/config/helpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ function getParsedCommandJson(
1515
return ts.parseJsonConfigFileContent(
1616
parsed.config,
1717
host,
18-
basePath ?? host.sys.getCurrentDirectory(),
18+
basePath ?? ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), host.sys.getCurrentDirectory()),
1919
existingOptions,
20-
configFileName,
20+
ts.getNormalizedAbsolutePath(configFileName, host.sys.getCurrentDirectory()),
2121
/*resolutionStack*/ undefined,
2222
/*extraFileExtensions*/ undefined,
2323
/*extendedConfigCache*/ undefined,
@@ -37,9 +37,9 @@ function getParsedCommandJsonSourceFile(
3737
return ts.parseJsonSourceFileConfigFileContent(
3838
parsed,
3939
host,
40-
basePath ?? host.sys.getCurrentDirectory(),
40+
basePath ?? ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), host.sys.getCurrentDirectory()),
4141
existingOptions,
42-
configFileName,
42+
ts.getNormalizedAbsolutePath(configFileName, host.sys.getCurrentDirectory()),
4343
/*resolutionStack*/ undefined,
4444
/*extraFileExtensions*/ undefined,
4545
/*extendedConfigCache*/ undefined,

src/testRunner/unittests/tscWatch/watchApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe("unittests:: tsc-watch:: watchAPI:: tsc-watch with custom module resolu
4646
system: sys,
4747
cb,
4848
});
49-
const parsedCommandResult = ts.parseJsonConfigFileContent(configFileJson, sys, config.path);
49+
const parsedCommandResult = ts.parseJsonConfigFileContent(configFileJson, sys, ts.getDirectoryPath(config.path));
5050
host.resolveModuleNames = (moduleNames, containingFile) =>
5151
moduleNames.map(m => {
5252
const result = ts.resolveModuleName(m, containingFile, parsedCommandResult.options, host);

tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js

Lines changed: 69 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,11 @@ CompilerOptions::
382382
"allowJs": true,
383383
"noImplicitAny": true,
384384
"strictNullChecks": true,
385-
"configFilePath": "tsconfig.json"
385+
"configFilePath": "c:/dev/tsconfig.json"
386386
}
387387
FileNames::
388-
c:/dev/main.ts,c:/dev/supplemental.ts
388+
c:/dev/main.ts
389+
c:/dev/supplemental.ts
389390
Errors::
390391

391392

@@ -396,10 +397,11 @@ CompilerOptions::
396397
"allowJs": true,
397398
"noImplicitAny": true,
398399
"strictNullChecks": false,
399-
"configFilePath": "tsconfig.nostrictnull.json"
400+
"configFilePath": "c:/dev/tsconfig.nostrictnull.json"
400401
}
401402
FileNames::
402-
c:/dev/main.ts,c:/dev/supplemental.ts
403+
c:/dev/main.ts
404+
c:/dev/supplemental.ts
403405
Errors::
404406

405407

@@ -408,10 +410,14 @@ configFileName:: circular.json
408410
CompilerOptions::
409411
{
410412
"module": 2,
411-
"configFilePath": "circular.json"
413+
"configFilePath": "c:/dev/circular.json"
412414
}
413415
FileNames::
414-
c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts
416+
c:/dev/main.ts
417+
c:/dev/supplemental.ts
418+
c:/dev/tests/utils.ts
419+
c:/dev/tests/baselines/first/output.ts
420+
c:/dev/tests/unit/spec.ts
415421
Errors::
416422
error TS18000: Circularity detected while resolving configuration: c:/dev/circular.json -> c:/dev/circular2.json -> c:/dev/circular.json
417423

@@ -421,10 +427,14 @@ configFileName:: missing.json
421427
CompilerOptions::
422428
{
423429
"types": [],
424-
"configFilePath": "missing.json"
430+
"configFilePath": "c:/dev/missing.json"
425431
}
426432
FileNames::
427-
c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts
433+
c:/dev/main.ts
434+
c:/dev/supplemental.ts
435+
c:/dev/tests/utils.ts
436+
c:/dev/tests/baselines/first/output.ts
437+
c:/dev/tests/unit/spec.ts
428438
Errors::
429439
error TS6053: File './missing2' not found.
430440

@@ -434,10 +444,14 @@ configFileName:: failure.json
434444
CompilerOptions::
435445
{
436446
"typeRoots": [],
437-
"configFilePath": "failure.json"
447+
"configFilePath": "c:/dev/failure.json"
438448
}
439449
FileNames::
440-
c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts
450+
c:/dev/main.ts
451+
c:/dev/supplemental.ts
452+
c:/dev/tests/utils.ts
453+
c:/dev/tests/baselines/first/output.ts
454+
c:/dev/tests/unit/spec.ts
441455
Errors::
442456
failure2.json:2:3 - error TS6114: Unknown option 'excludes'. Did you mean 'exclude'?
443457

@@ -449,10 +463,14 @@ can error when 'extends' is not a string or Array
449463
configFileName:: extends.json
450464
CompilerOptions::
451465
{
452-
"configFilePath": "extends.json"
466+
"configFilePath": "c:/dev/extends.json"
453467
}
454468
FileNames::
455-
c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts
469+
c:/dev/main.ts
470+
c:/dev/supplemental.ts
471+
c:/dev/tests/utils.ts
472+
c:/dev/tests/baselines/first/output.ts
473+
c:/dev/tests/unit/spec.ts
456474
Errors::
457475
error TS5024: Compiler option 'extends' requires a value of type string or Array.
458476

@@ -461,10 +479,14 @@ can error when 'extends' is given an empty string
461479
configFileName:: extends3.json
462480
CompilerOptions::
463481
{
464-
"configFilePath": "extends3.json"
482+
"configFilePath": "c:/dev/extends3.json"
465483
}
466484
FileNames::
467-
c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts
485+
c:/dev/main.ts
486+
c:/dev/supplemental.ts
487+
c:/dev/tests/utils.ts
488+
c:/dev/tests/baselines/first/output.ts
489+
c:/dev/tests/unit/spec.ts
468490
Errors::
469491
error TS18051: Compiler option 'extends' cannot be given an empty string.
470492

@@ -473,10 +495,14 @@ can error when 'extends' is given an empty string in an array
473495
configFileName:: extends4.json
474496
CompilerOptions::
475497
{
476-
"configFilePath": "extends4.json"
498+
"configFilePath": "c:/dev/extends4.json"
477499
}
478500
FileNames::
479-
c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts
501+
c:/dev/main.ts
502+
c:/dev/supplemental.ts
503+
c:/dev/tests/utils.ts
504+
c:/dev/tests/baselines/first/output.ts
505+
c:/dev/tests/unit/spec.ts
480506
Errors::
481507
error TS18051: Compiler option 'extends' cannot be given an empty string.
482508

@@ -488,7 +514,7 @@ CompilerOptions::
488514
"allowJs": true,
489515
"noImplicitAny": true,
490516
"strictNullChecks": true,
491-
"configFilePath": "configs/third.json"
517+
"configFilePath": "c:/dev/configs/third.json"
492518
}
493519
FileNames::
494520
c:/dev/supplemental.ts
@@ -503,10 +529,11 @@ CompilerOptions::
503529
"noImplicitAny": true,
504530
"strictNullChecks": true,
505531
"module": 4,
506-
"configFilePath": "configs/fourth.json"
532+
"configFilePath": "c:/dev/configs/fourth.json"
507533
}
508534
FileNames::
509535
c:/dev/main.ts
536+
c:/dev/supplemental.ts
510537
Errors::
511538

512539

@@ -518,7 +545,7 @@ CompilerOptions::
518545
"noImplicitAny": true,
519546
"strictNullChecks": true,
520547
"module": 4,
521-
"configFilePath": "configs/fifth.json"
548+
"configFilePath": "c:/dev/configs/fifth.json"
522549
}
523550
FileNames::
524551
c:/dev/tests/utils.ts
@@ -530,7 +557,7 @@ configFileName:: tsconfig.extendsBox.json
530557
CompilerOptions::
531558
{
532559
"strict": true,
533-
"configFilePath": "tsconfig.extendsBox.json"
560+
"configFilePath": "c:/dev/tsconfig.extendsBox.json"
534561
}
535562
FileNames::
536563
c:/dev/main.ts
@@ -542,7 +569,7 @@ configFileName:: tsconfig.extendsStrict.json
542569
CompilerOptions::
543570
{
544571
"strict": true,
545-
"configFilePath": "tsconfig.extendsStrict.json"
572+
"configFilePath": "c:/dev/tsconfig.extendsStrict.json"
546573
}
547574
FileNames::
548575
c:/dev/main.ts
@@ -554,7 +581,7 @@ configFileName:: tsconfig.extendsUnStrict.json
554581
CompilerOptions::
555582
{
556583
"strict": false,
557-
"configFilePath": "tsconfig.extendsUnStrict.json"
584+
"configFilePath": "c:/dev/tsconfig.extendsUnStrict.json"
558585
}
559586
FileNames::
560587
c:/dev/main.ts
@@ -566,7 +593,7 @@ configFileName:: tsconfig.extendsStrictExtension.json
566593
CompilerOptions::
567594
{
568595
"strict": true,
569-
"configFilePath": "tsconfig.extendsStrictExtension.json"
596+
"configFilePath": "c:/dev/tsconfig.extendsStrictExtension.json"
570597
}
571598
FileNames::
572599
c:/dev/main.ts
@@ -578,7 +605,7 @@ configFileName:: tsconfig.extendsBoxImplied.json
578605
CompilerOptions::
579606
{
580607
"strict": true,
581-
"configFilePath": "tsconfig.extendsBoxImplied.json"
608+
"configFilePath": "c:/dev/tsconfig.extendsBoxImplied.json"
582609
}
583610
FileNames::
584611
c:/dev/main.ts
@@ -590,7 +617,7 @@ configFileName:: tsconfig.extendsBoxImpliedUnstrict.json
590617
CompilerOptions::
591618
{
592619
"strict": false,
593-
"configFilePath": "tsconfig.extendsBoxImpliedUnstrict.json"
620+
"configFilePath": "c:/dev/tsconfig.extendsBoxImpliedUnstrict.json"
594621
}
595622
FileNames::
596623
c:/dev/main.ts
@@ -602,7 +629,7 @@ configFileName:: tsconfig.extendsBoxImpliedUnstrictExtension.json
602629
CompilerOptions::
603630
{
604631
"strict": false,
605-
"configFilePath": "tsconfig.extendsBoxImpliedUnstrictExtension.json"
632+
"configFilePath": "c:/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json"
606633
}
607634
FileNames::
608635
c:/dev/main.ts
@@ -614,7 +641,7 @@ configFileName:: tsconfig.extendsBoxImpliedPath.json
614641
CompilerOptions::
615642
{
616643
"strict": true,
617-
"configFilePath": "tsconfig.extendsBoxImpliedPath.json"
644+
"configFilePath": "c:/dev/tsconfig.extendsBoxImpliedPath.json"
618645
}
619646
FileNames::
620647
c:/dev/main.ts
@@ -626,7 +653,7 @@ configFileName:: tsconfig.extendsFoo.json
626653
CompilerOptions::
627654
{
628655
"strict": true,
629-
"configFilePath": "tsconfig.extendsFoo.json"
656+
"configFilePath": "c:/dev/tsconfig.extendsFoo.json"
630657
}
631658
FileNames::
632659
c:/dev/main.ts
@@ -641,10 +668,10 @@ CompilerOptions::
641668
"noImplicitAny": false,
642669
"strictNullChecks": false,
643670
"module": 4,
644-
"configFilePath": "configs/extendsArrayFifth.json"
671+
"configFilePath": "c:/dev/configs/extendsArrayFifth.json"
645672
}
646673
FileNames::
647-
674+
c:/dev/supplemental.ts
648675
Errors::
649676

650677

@@ -653,10 +680,14 @@ configFileName:: extendsArrayFails.json
653680
CompilerOptions::
654681
{
655682
"types": [],
656-
"configFilePath": "extendsArrayFails.json"
683+
"configFilePath": "c:/dev/extendsArrayFails.json"
657684
}
658685
FileNames::
659-
c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts
686+
c:/dev/main.ts
687+
c:/dev/supplemental.ts
688+
c:/dev/tests/utils.ts
689+
c:/dev/tests/baselines/first/output.ts
690+
c:/dev/tests/unit/spec.ts
660691
Errors::
661692
error TS6053: File './missingFile' not found.
662693

@@ -665,10 +696,14 @@ can error when 'extends' is not a string or Array2
665696
configFileName:: extendsArrayFails2.json
666697
CompilerOptions::
667698
{
668-
"configFilePath": "extendsArrayFails2.json"
699+
"configFilePath": "c:/dev/extendsArrayFails2.json"
669700
}
670701
FileNames::
671-
c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts
702+
c:/dev/main.ts
703+
c:/dev/supplemental.ts
704+
c:/dev/tests/utils.ts
705+
c:/dev/tests/baselines/first/output.ts
706+
c:/dev/tests/unit/spec.ts
672707
Errors::
673708
error TS5024: Compiler option 'extends' requires a value of type string.
674709

0 commit comments

Comments
 (0)