Some test cases to verify that declaration file overwrite is reported correctly
This commit is contained in:
parent
ff933be5ff
commit
bf05ea3b2f
6 changed files with 77 additions and 0 deletions
|
@ -0,0 +1,12 @@
|
|||
error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' which is one of the input files.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'a.d.ts' which is one of the input files.
|
||||
==== tests/cases/compiler/a.d.ts (0 errors) ====
|
||||
|
||||
declare class c {
|
||||
}
|
||||
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
class d {
|
||||
}
|
17
tests/baselines/reference/declarationFileOverwriteError.js
Normal file
17
tests/baselines/reference/declarationFileOverwriteError.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
//// [tests/cases/compiler/declarationFileOverwriteError.ts] ////
|
||||
|
||||
//// [a.d.ts]
|
||||
|
||||
declare class c {
|
||||
}
|
||||
|
||||
//// [a.ts]
|
||||
class d {
|
||||
}
|
||||
|
||||
//// [a.js]
|
||||
var d = (function () {
|
||||
function d() {
|
||||
}
|
||||
return d;
|
||||
})();
|
|
@ -0,0 +1,12 @@
|
|||
error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' which is one of the input files.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'out.d.ts' which is one of the input files.
|
||||
==== tests/cases/compiler/out.d.ts (0 errors) ====
|
||||
|
||||
declare class c {
|
||||
}
|
||||
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
class d {
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
//// [tests/cases/compiler/declarationFileOverwriteErrorWithOut.ts] ////
|
||||
|
||||
//// [out.d.ts]
|
||||
|
||||
declare class c {
|
||||
}
|
||||
|
||||
//// [a.ts]
|
||||
class d {
|
||||
}
|
||||
|
||||
//// [out.js]
|
||||
var d = (function () {
|
||||
function d() {
|
||||
}
|
||||
return d;
|
||||
})();
|
9
tests/cases/compiler/declarationFileOverwriteError.ts
Normal file
9
tests/cases/compiler/declarationFileOverwriteError.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
// @declaration: true
|
||||
|
||||
// @Filename: a.d.ts
|
||||
declare class c {
|
||||
}
|
||||
|
||||
// @FileName: a.ts
|
||||
class d {
|
||||
}
|
10
tests/cases/compiler/declarationFileOverwriteErrorWithOut.ts
Normal file
10
tests/cases/compiler/declarationFileOverwriteErrorWithOut.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
// @declaration: true
|
||||
// @out: tests/cases/compiler/out.js
|
||||
|
||||
// @Filename: out.d.ts
|
||||
declare class c {
|
||||
}
|
||||
|
||||
// @FileName: a.ts
|
||||
class d {
|
||||
}
|
Loading…
Reference in a new issue