Skip to content

Commit 33b7149

Browse files
author
Kanchalai Tanglertsampan
committed
Add tests and baselines
1 parent 03eb4ac commit 33b7149

6 files changed

+68
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
tests/cases/compiler/1.ts(2,1): error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'.
2+
3+
4+
==== tests/cases/compiler/1.ts (1 errors) ====
5+
6+
export var j = "hello"
7+
~~~~~~~~~~~~~~~~~~~~~~
8+
!!! error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'.
9+
10+
==== tests/cases/compiler/0.d.ts (0 errors) ====
11+
export = a;
12+
declare var a: number;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//// [tests/cases/compiler/noErrorUsingImportExportModuleAugmentationInDeclarationFile2.ts] ////
2+
3+
//// [1.ts]
4+
5+
export var j = "hello"
6+
7+
//// [0.d.ts]
8+
export = a;
9+
declare var a: number;
10+
11+
//// [1.js]
12+
"use strict";
13+
exports.j = "hello";
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
tests/cases/compiler/1.ts(1,1): error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'.
2+
3+
4+
==== tests/cases/compiler/0.d.ts (0 errors) ====
5+
6+
export = a;
7+
declare var a: number;
8+
9+
==== tests/cases/compiler/1.ts (1 errors) ====
10+
export var j = "hello"
11+
~~~~~~~~~~~~~~~~~~~~~~
12+
!!! error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'.
13+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//// [tests/cases/compiler/noErrorUsingImportExportModuleAugmentationInDeclarationFile3.ts] ////
2+
3+
//// [0.d.ts]
4+
5+
export = a;
6+
declare var a: number;
7+
8+
//// [1.ts]
9+
export var j = "hello"
10+
11+
12+
//// [1.js]
13+
"use strict";
14+
exports.j = "hello";
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// @module: none
2+
3+
// @filename: 1.ts
4+
export var j = "hello"; // error
5+
6+
// @filename: 0.d.ts
7+
export = a;
8+
declare var a: number;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// @module: none
2+
3+
// @filename: 0.d.ts
4+
export = a;
5+
declare var a: number;
6+
7+
// @filename: 1.ts
8+
export var j = "hello"; // error

0 commit comments

Comments
 (0)