mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-13 22:00:59 -05:00
Allow declarationMap to be emitted when transpiling declarations and option is enabled (#59337)
This commit is contained in:
@@ -48,7 +48,11 @@ enum TranspileKind {
|
||||
}
|
||||
|
||||
class TranspileTestCase {
|
||||
static varyBy = [];
|
||||
static varyBy = [
|
||||
"declarationMap",
|
||||
"sourceMap",
|
||||
"inlineSourceMap",
|
||||
];
|
||||
|
||||
static getConfigurations(file: string): TranspileTestCase[] {
|
||||
const ext = vpath.extname(file);
|
||||
@@ -104,6 +108,13 @@ class TranspileTestCase {
|
||||
if (!result.outputText.endsWith("\n")) {
|
||||
baselineText += "\r\n";
|
||||
}
|
||||
if (result.sourceMapText) {
|
||||
baselineText += `//// [${ts.changeExtension(unit.name, kind === TranspileKind.Module ? this.getJsOutputExtension(unit.name) : ts.getDeclarationEmitExtensionForPath(unit.name))}.map] ////\r\n`;
|
||||
baselineText += result.sourceMapText;
|
||||
if (!result.outputText.endsWith("\n")) {
|
||||
baselineText += "\r\n";
|
||||
}
|
||||
}
|
||||
if (result.diagnostics && result.diagnostics.length) {
|
||||
baselineText += "\r\n\r\n//// [Diagnostics reported]\r\n";
|
||||
baselineText += Compiler.getErrorBaseline([{ content: unit.content, unitName: unit.name }], result.diagnostics, !!opts.pretty);
|
||||
|
||||
Reference in New Issue
Block a user