mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Don't access sys.newLine inside unit tests
This commit is contained in:
@@ -895,7 +895,7 @@ namespace ts {
|
||||
* @param fileNames array of filenames to be generated into tsconfig.json
|
||||
*/
|
||||
/* @internal */
|
||||
export function generateTSConfig(options: CompilerOptions, fileNames: string[]): string {
|
||||
export function generateTSConfig(options: CompilerOptions, fileNames: string[], newLine: string): string {
|
||||
const compilerOptions = extend(options, defaultInitCompilerOptions);
|
||||
const configurations: { compilerOptions: MapLike<CompilerOptionsValue>; files?: string[] } = {
|
||||
compilerOptions: serializeCompilerOptions(compilerOptions)
|
||||
@@ -1053,7 +1053,7 @@ namespace ts {
|
||||
}
|
||||
result.push(`}`);
|
||||
|
||||
return result.join(sys.newLine);
|
||||
return result.join(newLine);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -739,7 +739,7 @@ namespace ts {
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.A_tsconfig_json_file_is_already_defined_at_Colon_0, file), /* host */ undefined);
|
||||
}
|
||||
else {
|
||||
sys.writeFile(file, generateTSConfig(options, fileNames));
|
||||
sys.writeFile(file, generateTSConfig(options, fileNames, sys.newLine));
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Successfully_created_a_tsconfig_json_file), /* host */ undefined);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user