@@ -403,7 +403,6 @@ export namespace Compiler {
403403 compilerOptions : ts . CompilerOptions | undefined ,
404404 // Current directory is needed for rwcRunner to be able to use currentDirectory defined in json file
405405 currentDirectory : string | undefined ,
406- rootDir ?: string ,
407406 symlinks ?: vfs . FileSet
408407 ) : compiler . CompilationResult {
409408 const options : ts . CompilerOptions & HarnessOptions = compilerOptions ? ts . cloneCompilerOptions ( compilerOptions ) : { noResolve : false } ;
@@ -451,7 +450,7 @@ export namespace Compiler {
451450 fs . apply ( symlinks ) ;
452451 }
453452
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 ) ) ) ;
455454 const host = new fakes . CompilerHost ( fs , options ) ;
456455 const result = compiler . compileFiles ( host , programFileNames , options , typeScriptVersion ) ;
457456 result . symlinks = symlinks ;
@@ -545,7 +544,7 @@ export namespace Compiler {
545544 return ;
546545 }
547546 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 ) ;
549548 return { declInputFiles, declOtherFiles, declResult : output } ;
550549 }
551550
@@ -735,7 +734,7 @@ export namespace Compiler {
735734 ! errors || ( errors . length === 0 ) ? null : getErrorBaseline ( inputFiles , errors , pretty ) ) ; // eslint-disable-line no-null/no-null
736735 }
737736
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 ) {
739738 // The full walker simulates the types that you would get from doing a full
740739 // compile. The pull walker simulates the types you get when you just do
741740 // a type query for a random node (like how the LS would do it). Most of the
@@ -810,7 +809,7 @@ export namespace Compiler {
810809 const [ , content ] = value ;
811810 result += content ;
812811 }
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
814813 }
815814
816815 function * iterateBaseLine ( isSymbolBaseline : boolean , skipBaseline ?: boolean ) : IterableIterator < [ string , string ] > {
@@ -911,9 +910,8 @@ export namespace Compiler {
911910 // check js output
912911 let tsCode = "" ;
913912 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+
917915 for ( let i = 0 ; i < tsSources . length ; i ++ ) {
918916 tsCode += "//// [" + ts . getBaseFileName ( tsSources [ i ] . unitName ) + "]\r\n" ;
919917 tsCode += tsSources [ i ] . content + ( i < ( tsSources . length - 1 ) ? "\r\n" : "" ) ;
@@ -1208,7 +1206,7 @@ export namespace TestCaseParser {
12081206 }
12091207
12101208 /** 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 {
12121210 // List of all the subfiles we've parsed out
12131211 const testUnitData : TestUnitData [ ] = [ ] ;
12141212
@@ -1223,7 +1221,7 @@ export namespace TestCaseParser {
12231221
12241222 for ( const line of lines ) {
12251223 let testMetaData : RegExpExecArray | null ;
1226- const possiblySymlinks = parseSymlinkFromTest ( line , symlinks , ts . getNormalizedAbsolutePath ( rootDir , vfs . srcFolder ) ) ;
1224+ const possiblySymlinks = parseSymlinkFromTest ( line , symlinks , vfs . srcFolder ) ;
12271225 if ( possiblySymlinks ) {
12281226 symlinks = possiblySymlinks ;
12291227 }
@@ -1294,7 +1292,7 @@ export namespace TestCaseParser {
12941292 const files : string [ ] = [ ] ;
12951293 const directories = new Set < string > ( ) ;
12961294 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 ) ;
12981296 if ( fileName . toLowerCase ( ) . startsWith ( dir . toLowerCase ( ) ) ) {
12991297 let path = fileName . substring ( dir . length ) ;
13001298 if ( path . startsWith ( "/" ) ) {
@@ -1325,7 +1323,7 @@ export namespace TestCaseParser {
13251323 if ( getConfigNameFromFileName ( data . name ) ) {
13261324 const configJson = ts . parseJsonText ( data . name , data . content ) ;
13271325 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 ) ;
13291327 const configDir = ts . getDirectoryPath ( configFileName ) ;
13301328 tsConfig = ts . parseJsonSourceFileConfigFileContent ( configJson , parseConfigHost , configDir , /*existingOptions*/ undefined , configFileName ) ;
13311329 tsConfigFileUnitData = data ;
0 commit comments