mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-12 20:01:02 -05:00
Adding testcase for the incorrect eliding of the import declarations
This commit is contained in:
26
tests/baselines/reference/elidingImportNames.js
Normal file
26
tests/baselines/reference/elidingImportNames.js
Normal file
@@ -0,0 +1,26 @@
|
||||
//// [tests/cases/compiler/elidingImportNames.ts] ////
|
||||
|
||||
//// [elidingImportNames_test.ts]
|
||||
|
||||
import a = require('elidingImportNames_main'); // alias used in typeof
|
||||
var b = a;
|
||||
var x: typeof a;
|
||||
import a2 = require('elidingImportNames_main1'); // alias not used in typeof
|
||||
var b2 = a2;
|
||||
|
||||
|
||||
//// [elidingImportNames_main.ts]
|
||||
export var main = 10;
|
||||
|
||||
//// [elidingImportNames_main1.ts]
|
||||
export var main = 10;
|
||||
|
||||
//// [elidingImportNames_main.js]
|
||||
exports.main = 10;
|
||||
//// [elidingImportNames_main1.js]
|
||||
exports.main = 10;
|
||||
//// [elidingImportNames_test.js]
|
||||
var b = a;
|
||||
var x;
|
||||
var a2 = require('elidingImportNames_main1'); // alias not used in typeof
|
||||
var b2 = a2;
|
||||
29
tests/baselines/reference/elidingImportNames.types
Normal file
29
tests/baselines/reference/elidingImportNames.types
Normal file
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/compiler/elidingImportNames_test.ts ===
|
||||
|
||||
import a = require('elidingImportNames_main'); // alias used in typeof
|
||||
>a : typeof a
|
||||
|
||||
var b = a;
|
||||
>b : typeof a
|
||||
>a : typeof a
|
||||
|
||||
var x: typeof a;
|
||||
>x : typeof a
|
||||
>a : typeof a
|
||||
|
||||
import a2 = require('elidingImportNames_main1'); // alias not used in typeof
|
||||
>a2 : typeof a2
|
||||
|
||||
var b2 = a2;
|
||||
>b2 : typeof a2
|
||||
>a2 : typeof a2
|
||||
|
||||
|
||||
=== tests/cases/compiler/elidingImportNames_main.ts ===
|
||||
export var main = 10;
|
||||
>main : number
|
||||
|
||||
=== tests/cases/compiler/elidingImportNames_main1.ts ===
|
||||
export var main = 10;
|
||||
>main : number
|
||||
|
||||
15
tests/cases/compiler/elidingImportNames.ts
Normal file
15
tests/cases/compiler/elidingImportNames.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// @module: commonjs
|
||||
|
||||
// @Filename: elidingImportNames_test.ts
|
||||
import a = require('elidingImportNames_main'); // alias used in typeof
|
||||
var b = a;
|
||||
var x: typeof a;
|
||||
import a2 = require('elidingImportNames_main1'); // alias not used in typeof
|
||||
var b2 = a2;
|
||||
|
||||
|
||||
// @Filename: elidingImportNames_main.ts
|
||||
export var main = 10;
|
||||
|
||||
// @Filename: elidingImportNames_main1.ts
|
||||
export var main = 10;
|
||||
Reference in New Issue
Block a user