Skip to content

Commit 1bdcaa3

Browse files
committed
added tests for import\export elision
1 parent 1803d73 commit 1bdcaa3

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
tests/cases/compiler/separateCompilationImportExportElision.ts(2,17): error TS2307: Cannot find external module 'module'.
2+
tests/cases/compiler/separateCompilationImportExportElision.ts(3,18): error TS2307: Cannot find external module 'module'.
3+
tests/cases/compiler/separateCompilationImportExportElision.ts(4,21): error TS2307: Cannot find external module 'module'.
4+
tests/cases/compiler/separateCompilationImportExportElision.ts(12,18): error TS2307: Cannot find external module 'module'.
5+
6+
7+
==== tests/cases/compiler/separateCompilationImportExportElision.ts (4 errors) ====
8+
9+
import {c} from "module"
10+
~~~~~~~~
11+
!!! error TS2307: Cannot find external module 'module'.
12+
import {c2} from "module"
13+
~~~~~~~~
14+
!!! error TS2307: Cannot find external module 'module'.
15+
import * as ns from "module"
16+
~~~~~~~~
17+
!!! error TS2307: Cannot find external module 'module'.
18+
19+
class C extends c2.C {
20+
}
21+
22+
let x = new c();
23+
let y = ns.value;
24+
25+
export {c1} from "module";
26+
~~~~~~~~
27+
!!! error TS2307: Cannot find external module 'module'.
28+
export var z = x;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//// [separateCompilationImportExportElision.ts]
2+
3+
import {c} from "module"
4+
import {c2} from "module"
5+
import * as ns from "module"
6+
7+
class C extends c2.C {
8+
}
9+
10+
let x = new c();
11+
let y = ns.value;
12+
13+
export {c1} from "module";
14+
export var z = x;
15+
16+
//// [separateCompilationImportExportElision.js]
17+
var __extends = this.__extends || function (d, b) {
18+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
19+
function __() { this.constructor = d; }
20+
__.prototype = b.prototype;
21+
d.prototype = new __();
22+
};
23+
var module_1 = require("module");
24+
var module_2 = require("module");
25+
var ns = require("module");
26+
var C = (function (_super) {
27+
__extends(C, _super);
28+
function C() {
29+
_super.apply(this, arguments);
30+
}
31+
return C;
32+
})(module_2.c2.C);
33+
var x = new module_1.c();
34+
var y = ns.value;
35+
var module_3 = require("module");
36+
exports.c1 = module_3.c1;
37+
exports.z = x;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// @separateCompilation: true
2+
// @target: es5
3+
// @module: commonjs
4+
5+
// @filename: file1.ts
6+
import {c} from "module"
7+
import {c2} from "module"
8+
import * as ns from "module"
9+
10+
class C extends c2.C {
11+
}
12+
13+
let x = new c();
14+
let y = ns.value;
15+
16+
export {c1} from "module";
17+
export var z = x;

0 commit comments

Comments
 (0)