Skip to content

Commit 0b247b1

Browse files
committed
Add tests
1 parent 9f0c5ce commit 0b247b1

File tree

6 files changed

+60
-0
lines changed

6 files changed

+60
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
2+
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
3+
tests/cases/compiler/a.js(3,1): error TS2322: Type '0' is not assignable to type 'string'.
4+
5+
6+
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
7+
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
8+
==== tests/cases/compiler/a.js (1 errors) ====
9+
10+
var x = "string";
11+
x = 0;
12+
~
13+
!!! error TS2322: Type '0' is not assignable to type 'string'.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
2+
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
3+
tests/cases/compiler/a.js(4,1): error TS2322: Type '0' is not assignable to type 'string'.
4+
5+
6+
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
7+
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
8+
==== tests/cases/compiler/a.js (1 errors) ====
9+
10+
// @check
11+
var x = "string";
12+
x = 0;
13+
~
14+
!!! error TS2322: Type '0' is not assignable to type 'string'.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
2+
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
3+
tests/cases/compiler/a.js(4,1): error TS2322: Type '0' is not assignable to type 'string'.
4+
5+
6+
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
7+
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
8+
==== tests/cases/compiler/a.js (1 errors) ====
9+
10+
// @check
11+
var x = "string";
12+
x = 0;
13+
~
14+
!!! error TS2322: Type '0' is not assignable to type 'string'.

tests/cases/compiler/checkJsFiles.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @allowJs: true
2+
// @checkJsFiles: true
3+
4+
// @fileName: a.js
5+
var x = "string";
6+
x = 0;

tests/cases/compiler/checkJsFiles2.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// @allowJs: true
2+
// @checkJsFiles: false
3+
4+
// @fileName: a.js
5+
// @check
6+
var x = "string";
7+
x = 0;

tests/cases/compiler/checkJsFiles3.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @allowJs: true
2+
3+
// @fileName: a.js
4+
// @check
5+
var x = "string";
6+
x = 0;

0 commit comments

Comments
 (0)