mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 20:37:00 -05:00
Fix tests after rebase
This commit is contained in:
@@ -374,7 +374,6 @@ namespace ts {
|
||||
|
||||
export function readBuilderProgram(compilerOptions: CompilerOptions, readFile: (path: string) => string | undefined) {
|
||||
if (compilerOptions.out || compilerOptions.outFile) return undefined;
|
||||
if (!isIncrementalCompilation(compilerOptions)) return undefined;
|
||||
const buildInfoPath = getOutputPathForBuildInfo(compilerOptions);
|
||||
if (!buildInfoPath) return undefined;
|
||||
const content = readFile(buildInfoPath);
|
||||
@@ -658,7 +657,7 @@ namespace ts {
|
||||
((typeDirectiveNames, containingFile, redirectedReference) => resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference));
|
||||
const userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
||||
|
||||
readBuilderProgram(compilerOptions, path => compilerHost.readFile(path));
|
||||
builderProgram = readBuilderProgram(compilerOptions, path => compilerHost.readFile(path)) as any as T;
|
||||
synchronizeProgram();
|
||||
|
||||
// Update the wild card directory watch
|
||||
|
||||
@@ -99,13 +99,7 @@ namespace ts {
|
||||
// outputs
|
||||
...outputFiles[project.first],
|
||||
...outputFiles[project.second],
|
||||
|
||||
// build info
|
||||
outputFiles[project.third][ext.buildinfo],
|
||||
],
|
||||
// These are first not present and later read new contents to generate third output
|
||||
outputFiles[project.first][ext.buildinfo],
|
||||
outputFiles[project.second][ext.buildinfo]
|
||||
]
|
||||
);
|
||||
|
||||
let dtsChangedExpectedDiagnostics: ReadonlyArray<fakes.ExpectedDiagnostic> = [
|
||||
@@ -131,12 +125,8 @@ namespace ts {
|
||||
...outputFiles[project.first],
|
||||
...outputFiles[project.second],
|
||||
outputFiles[project.third][ext.dts],
|
||||
|
||||
// build info
|
||||
outputFiles[project.third][ext.buildinfo],
|
||||
],
|
||||
outputFiles[project.first][ext.dts], // dts changes so once read old content, and once new (to emit third)
|
||||
outputFiles[project.first][ext.buildinfo], // since first build info changes
|
||||
);
|
||||
|
||||
let dtsChangedExpectedDiagnosticsDependOrdered: ReadonlyArray<fakes.ExpectedDiagnostic> = [
|
||||
@@ -173,8 +163,7 @@ namespace ts {
|
||||
...outputFiles[project.first],
|
||||
...outputFiles[project.second],
|
||||
...outputFiles[project.third],
|
||||
],
|
||||
outputFiles[project.first][ext.buildinfo], // since first build info changes
|
||||
]
|
||||
);
|
||||
|
||||
let dtsUnchangedExpectedDiagnosticsDependOrdered: ReadonlyArray<fakes.ExpectedDiagnostic> = [
|
||||
@@ -227,7 +216,6 @@ namespace ts {
|
||||
value.set(path, 1);
|
||||
}
|
||||
value.set(outputFiles[project.second][ext.dts], 2); // dts changes so once read old content, and once new (to emit third)
|
||||
value.set(outputFiles[project.second][ext.buildinfo], 2); // since first build info changes
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace ts.tscWatch {
|
||||
}
|
||||
|
||||
function checkFileEmit(actual: Map<string>, expected: ReadonlyArray<File>) {
|
||||
assert.equal(actual.size, expected.length, `Actual: ${JSON.stringify(arrayFrom(actual.entries()))}\nExpected: ${JSON.stringify(expected)}`);
|
||||
assert.equal(actual.size, expected.length, `Actual: ${JSON.stringify(arrayFrom(actual.entries()), /*replacer*/ undefined, " ")}\nExpected: ${JSON.stringify(expected, /*replacer*/ undefined, " ")}`);
|
||||
expected.forEach(file => assert.equal(actual.get(file.path), file.content, `Emit for ${file.path}`));
|
||||
}
|
||||
|
||||
@@ -93,7 +93,8 @@ namespace ts.tscWatch {
|
||||
referencedMap: {},
|
||||
exportedModulesMap: {},
|
||||
semanticDiagnosticsPerFile: [libFile.path, file1.path, file2.path]
|
||||
}
|
||||
},
|
||||
version
|
||||
})
|
||||
}
|
||||
],
|
||||
@@ -115,7 +116,8 @@ namespace ts.tscWatch {
|
||||
referencedMap: {},
|
||||
exportedModulesMap: {},
|
||||
semanticDiagnosticsPerFile: [libFile.path, file1.path, file2.path]
|
||||
}
|
||||
},
|
||||
version
|
||||
})
|
||||
}
|
||||
],
|
||||
@@ -170,7 +172,8 @@ namespace ts.tscWatch {
|
||||
file1.path,
|
||||
file2ReuasableError
|
||||
]
|
||||
}
|
||||
},
|
||||
version
|
||||
})
|
||||
}
|
||||
],
|
||||
@@ -196,7 +199,8 @@ namespace ts.tscWatch {
|
||||
file1.path,
|
||||
file2ReuasableError
|
||||
]
|
||||
}
|
||||
},
|
||||
version
|
||||
})
|
||||
}
|
||||
],
|
||||
@@ -228,7 +232,8 @@ namespace ts.tscWatch {
|
||||
{ pos: 0, end: outFile.content.length, kind: BundleFileSectionKind.Text }
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
version
|
||||
})
|
||||
}
|
||||
],
|
||||
@@ -294,7 +299,8 @@ namespace ts.tscWatch {
|
||||
referencedMap: {},
|
||||
exportedModulesMap: {},
|
||||
semanticDiagnosticsPerFile: [libFile.path, file1.path, file2.path]
|
||||
}
|
||||
},
|
||||
version
|
||||
})
|
||||
}
|
||||
],
|
||||
@@ -315,7 +321,8 @@ namespace ts.tscWatch {
|
||||
referencedMap: {},
|
||||
exportedModulesMap: {},
|
||||
semanticDiagnosticsPerFile: [libFile.path, file1.path, file2.path]
|
||||
}
|
||||
},
|
||||
version
|
||||
})
|
||||
}
|
||||
],
|
||||
@@ -370,7 +377,8 @@ namespace ts.tscWatch {
|
||||
file1.path,
|
||||
file2ReuasableError
|
||||
]
|
||||
}
|
||||
},
|
||||
version
|
||||
})
|
||||
}
|
||||
],
|
||||
@@ -395,7 +403,8 @@ namespace ts.tscWatch {
|
||||
file2ReuasableError,
|
||||
file1.path
|
||||
]
|
||||
}
|
||||
},
|
||||
version
|
||||
})
|
||||
}
|
||||
],
|
||||
@@ -435,7 +444,8 @@ namespace ts.tscWatch {
|
||||
{ pos: 0, end: outFile.content.length, kind: BundleFileSectionKind.Text }
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
version
|
||||
})
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user