mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Fix the incorrect declaration file path during d.ts file compile in the compilerrunner
This commit is contained in:
@@ -246,7 +246,7 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
var declFile = ts.forEach(result.declFilesCode,
|
||||
declFile => declFile.fileName === (file.unitName.substr(0, file.unitName.length - ".ts".length) + ".d.ts")
|
||||
? declFile : undefined);
|
||||
return { unitName: rootDir + Harness.Path.getFileName(declFile.fileName), content: declFile.code };
|
||||
return { unitName: declFile.fileName, content: declFile.code };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,30 +61,3 @@ export = Math;
|
||||
//// [Drawing.d.ts]
|
||||
export import Math = require('Math/Math');
|
||||
//// [consumer.d.ts]
|
||||
|
||||
|
||||
//// [DtsFileErrors]
|
||||
|
||||
|
||||
==== tests/cases/compiler/consumer.d.ts (0 errors) ====
|
||||
|
||||
==== tests/cases/compiler/Drawing.d.ts (1 errors) ====
|
||||
export import Math = require('Math/Math');
|
||||
~~~~~~~~~~~
|
||||
!!! Cannot find external module 'Math/Math'.
|
||||
|
||||
==== tests/cases/compiler/Math.d.ts (1 errors) ====
|
||||
import Adder = require('Math/Adder');
|
||||
~~~~~~~~~~~~
|
||||
!!! Cannot find external module 'Math/Adder'.
|
||||
declare var Math: {
|
||||
Adder: typeof Adder;
|
||||
};
|
||||
export = Math;
|
||||
|
||||
==== tests/cases/compiler/Adder.d.ts (0 errors) ====
|
||||
declare class Adder {
|
||||
add(a: number, b: number): void;
|
||||
}
|
||||
export = Adder;
|
||||
|
||||
Reference in New Issue
Block a user