@@ -403,7 +403,6 @@ export namespace Compiler {
403
403
compilerOptions : ts . CompilerOptions | undefined ,
404
404
// Current directory is needed for rwcRunner to be able to use currentDirectory defined in json file
405
405
currentDirectory : string | undefined ,
406
- rootDir ?: string ,
407
406
symlinks ?: vfs . FileSet
408
407
) : compiler . CompilationResult {
409
408
const options : ts . CompilerOptions & HarnessOptions = compilerOptions ? ts . cloneCompilerOptions ( compilerOptions ) : { noResolve : false } ;
@@ -451,7 +450,7 @@ export namespace Compiler {
451
450
fs . apply ( symlinks ) ;
452
451
}
453
452
454
- ts . assign ( options , ts . convertToOptionsWithAbsolutePaths ( options , path => ts . getNormalizedAbsolutePath ( ts . getNormalizedAbsolutePath ( path , rootDir ) , currentDirectory ) ) ) ;
453
+ ts . assign ( options , ts . convertToOptionsWithAbsolutePaths ( options , path => ts . getNormalizedAbsolutePath ( path , currentDirectory ) ) ) ;
455
454
const host = new fakes . CompilerHost ( fs , options ) ;
456
455
const result = compiler . compileFiles ( host , programFileNames , options , typeScriptVersion ) ;
457
456
result . symlinks = symlinks ;
@@ -545,7 +544,7 @@ export namespace Compiler {
545
544
return ;
546
545
}
547
546
const { declInputFiles, declOtherFiles, harnessSettings, options, currentDirectory } = context ;
548
- const output = compileFiles ( declInputFiles , declOtherFiles , harnessSettings , options , currentDirectory , /*rootDir*/ undefined , symlinks ) ;
547
+ const output = compileFiles ( declInputFiles , declOtherFiles , harnessSettings , options , currentDirectory , symlinks ) ;
549
548
return { declInputFiles, declOtherFiles, declResult : output } ;
550
549
}
551
550
@@ -735,7 +734,7 @@ export namespace Compiler {
735
734
! errors || ( errors . length === 0 ) ? null : getErrorBaseline ( inputFiles , errors , pretty ) ) ; // eslint-disable-line no-null/no-null
736
735
}
737
736
738
- export function doTypeAndSymbolBaseline ( baselinePath : string , program : ts . Program , allFiles : { unitName : string , content : string } [ ] , opts ?: Baseline . BaselineOptions , multifile ?: boolean , skipTypeBaselines ?: boolean , skipSymbolBaselines ?: boolean , hasErrorBaseline ?: boolean ) {
737
+ export function doTypeAndSymbolBaseline ( baselinePath : string , header : string , program : ts . Program , allFiles : { unitName : string , content : string } [ ] , opts ?: Baseline . BaselineOptions , multifile ?: boolean , skipTypeBaselines ?: boolean , skipSymbolBaselines ?: boolean , hasErrorBaseline ?: boolean ) {
739
738
// The full walker simulates the types that you would get from doing a full
740
739
// compile. The pull walker simulates the types you get when you just do
741
740
// a type query for a random node (like how the LS would do it). Most of the
@@ -810,7 +809,7 @@ export namespace Compiler {
810
809
const [ , content ] = value ;
811
810
result += content ;
812
811
}
813
- return result || null ; // eslint-disable-line no-null/no-null
812
+ return result ? ( `//// [ ${ header } ] ////\r\n\r\n` + result ) : null ; // eslint-disable-line no-null/no-null
814
813
}
815
814
816
815
function * iterateBaseLine ( isSymbolBaseline : boolean , skipBaseline ?: boolean ) : IterableIterator < [ string , string ] > {
@@ -911,9 +910,8 @@ export namespace Compiler {
911
910
// check js output
912
911
let tsCode = "" ;
913
912
const tsSources = otherFiles . concat ( toBeCompiled ) ;
914
- if ( tsSources . length > 1 ) {
915
- tsCode += "//// [" + header + "] ////\r\n\r\n" ;
916
- }
913
+ tsCode += "//// [" + header + "] ////\r\n\r\n" ;
914
+
917
915
for ( let i = 0 ; i < tsSources . length ; i ++ ) {
918
916
tsCode += "//// [" + ts . getBaseFileName ( tsSources [ i ] . unitName ) + "]\r\n" ;
919
917
tsCode += tsSources [ i ] . content + ( i < ( tsSources . length - 1 ) ? "\r\n" : "" ) ;
@@ -1208,7 +1206,7 @@ export namespace TestCaseParser {
1208
1206
}
1209
1207
1210
1208
/** Given a test file containing // @FileName directives, return an array of named units of code to be added to an existing compiler instance */
1211
- export function makeUnitsFromTest ( code : string , fileName : string , rootDir : string , settings = extractCompilerSettings ( code ) ) : TestCaseContent {
1209
+ export function makeUnitsFromTest ( code : string , fileName : string , settings = extractCompilerSettings ( code ) ) : TestCaseContent {
1212
1210
// List of all the subfiles we've parsed out
1213
1211
const testUnitData : TestUnitData [ ] = [ ] ;
1214
1212
@@ -1223,7 +1221,7 @@ export namespace TestCaseParser {
1223
1221
1224
1222
for ( const line of lines ) {
1225
1223
let testMetaData : RegExpExecArray | null ;
1226
- const possiblySymlinks = parseSymlinkFromTest ( line , symlinks , ts . getNormalizedAbsolutePath ( rootDir , vfs . srcFolder ) ) ;
1224
+ const possiblySymlinks = parseSymlinkFromTest ( line , symlinks , vfs . srcFolder ) ;
1227
1225
if ( possiblySymlinks ) {
1228
1226
symlinks = possiblySymlinks ;
1229
1227
}
@@ -1294,7 +1292,7 @@ export namespace TestCaseParser {
1294
1292
const files : string [ ] = [ ] ;
1295
1293
const directories = new Set < string > ( ) ;
1296
1294
for ( const unit of testUnitData ) {
1297
- const fileName = ts . getNormalizedAbsolutePath ( ts . getNormalizedAbsolutePath ( unit . name , rootDir ) , vfs . srcFolder ) ;
1295
+ const fileName = ts . getNormalizedAbsolutePath ( unit . name , vfs . srcFolder ) ;
1298
1296
if ( fileName . toLowerCase ( ) . startsWith ( dir . toLowerCase ( ) ) ) {
1299
1297
let path = fileName . substring ( dir . length ) ;
1300
1298
if ( path . startsWith ( "/" ) ) {
@@ -1325,7 +1323,7 @@ export namespace TestCaseParser {
1325
1323
if ( getConfigNameFromFileName ( data . name ) ) {
1326
1324
const configJson = ts . parseJsonText ( data . name , data . content ) ;
1327
1325
assert . isTrue ( configJson . endOfFileToken !== undefined ) ;
1328
- const configFileName = ts . getNormalizedAbsolutePath ( ts . getNormalizedAbsolutePath ( data . name , rootDir ) , vfs . srcFolder ) ;
1326
+ const configFileName = ts . getNormalizedAbsolutePath ( data . name , vfs . srcFolder ) ;
1329
1327
const configDir = ts . getDirectoryPath ( configFileName ) ;
1330
1328
tsConfig = ts . parseJsonSourceFileConfigFileContent ( configJson , parseConfigHost , configDir , /*existingOptions*/ undefined , configFileName ) ;
1331
1329
tsConfigFileUnitData = data ;
0 commit comments