mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Add more tests
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
tests/cases/compiler/es6modulekindWithES5Target10.ts(2,1): error TS1202: Import assignment cannot be used when targeting ECMAScript 6 modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
|
||||
tests/cases/compiler/es6modulekindWithES5Target10.ts(2,20): error TS2307: Cannot find module 'mod'.
|
||||
tests/cases/compiler/es6modulekindWithES5Target10.ts(7,1): error TS1203: Export assignment cannot be used when targeting ECMAScript 6 modules. Consider using 'export default' or another module format instead.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6modulekindWithES5Target10.ts (3 errors) ====
|
||||
|
||||
import i = require("mod"); // Error;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1202: Import assignment cannot be used when targeting ECMAScript 6 modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
|
||||
~~~~~
|
||||
!!! error TS2307: Cannot find module 'mod'.
|
||||
|
||||
|
||||
namespace N {
|
||||
}
|
||||
export = N; // Error
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1203: Export assignment cannot be used when targeting ECMAScript 6 modules. Consider using 'export default' or another module format instead.
|
||||
10
tests/baselines/reference/es6modulekindWithES5Target10.js
Normal file
10
tests/baselines/reference/es6modulekindWithES5Target10.js
Normal file
@@ -0,0 +1,10 @@
|
||||
//// [es6modulekindWithES5Target10.ts]
|
||||
|
||||
import i = require("mod"); // Error;
|
||||
|
||||
|
||||
namespace N {
|
||||
}
|
||||
export = N; // Error
|
||||
|
||||
//// [es6modulekindWithES5Target10.js]
|
||||
@@ -0,0 +1,33 @@
|
||||
tests/cases/compiler/es6modulekindWithES5Target9.ts(2,15): error TS2307: Cannot find module 'mod'.
|
||||
tests/cases/compiler/es6modulekindWithES5Target9.ts(4,17): error TS2307: Cannot find module 'mod'.
|
||||
tests/cases/compiler/es6modulekindWithES5Target9.ts(6,20): error TS2307: Cannot find module 'mod'.
|
||||
tests/cases/compiler/es6modulekindWithES5Target9.ts(10,15): error TS2307: Cannot find module 'mod'.
|
||||
tests/cases/compiler/es6modulekindWithES5Target9.ts(12,17): error TS2307: Cannot find module 'mod'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6modulekindWithES5Target9.ts (5 errors) ====
|
||||
|
||||
import d from "mod";
|
||||
~~~~~
|
||||
!!! error TS2307: Cannot find module 'mod'.
|
||||
|
||||
import {a} from "mod";
|
||||
~~~~~
|
||||
!!! error TS2307: Cannot find module 'mod'.
|
||||
|
||||
import * as M from "mod";
|
||||
~~~~~
|
||||
!!! error TS2307: Cannot find module 'mod'.
|
||||
|
||||
export {a};
|
||||
|
||||
export * from "mod";
|
||||
~~~~~
|
||||
!!! error TS2307: Cannot find module 'mod'.
|
||||
|
||||
export {b} from "mod"
|
||||
~~~~~
|
||||
!!! error TS2307: Cannot find module 'mod'.
|
||||
|
||||
export default d;
|
||||
|
||||
24
tests/baselines/reference/es6modulekindWithES5Target9.js
Normal file
24
tests/baselines/reference/es6modulekindWithES5Target9.js
Normal file
@@ -0,0 +1,24 @@
|
||||
//// [es6modulekindWithES5Target9.ts]
|
||||
|
||||
import d from "mod";
|
||||
|
||||
import {a} from "mod";
|
||||
|
||||
import * as M from "mod";
|
||||
|
||||
export {a};
|
||||
|
||||
export * from "mod";
|
||||
|
||||
export {b} from "mod"
|
||||
|
||||
export default d;
|
||||
|
||||
|
||||
//// [es6modulekindWithES5Target9.js]
|
||||
import d from "mod";
|
||||
import { a } from "mod";
|
||||
export { a };
|
||||
export * from "mod";
|
||||
export { b } from "mod";
|
||||
export default d;
|
||||
@@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/es6modulekindWithES5Target9.ts ===
|
||||
|
||||
export var {a, b } = { a: 0, b: 1 };
|
||||
>a : Symbol(a, Decl(es6modulekindWithES5Target9.ts, 1, 12))
|
||||
>b : Symbol(b, Decl(es6modulekindWithES5Target9.ts, 1, 14))
|
||||
>a : Symbol(a, Decl(es6modulekindWithES5Target9.ts, 1, 22))
|
||||
>b : Symbol(b, Decl(es6modulekindWithES5Target9.ts, 1, 28))
|
||||
|
||||
export var [d, e] = [1, 2];
|
||||
>d : Symbol(d, Decl(es6modulekindWithES5Target9.ts, 2, 12))
|
||||
>e : Symbol(e, Decl(es6modulekindWithES5Target9.ts, 2, 14))
|
||||
|
||||
18
tests/baselines/reference/es6modulekindWithES5Target9.types
Normal file
18
tests/baselines/reference/es6modulekindWithES5Target9.types
Normal file
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/compiler/es6modulekindWithES5Target9.ts ===
|
||||
|
||||
export var {a, b } = { a: 0, b: 1 };
|
||||
>a : number
|
||||
>b : number
|
||||
>{ a: 0, b: 1 } : { a: number; b: number; }
|
||||
>a : number
|
||||
>0 : number
|
||||
>b : number
|
||||
>1 : number
|
||||
|
||||
export var [d, e] = [1, 2];
|
||||
>d : number
|
||||
>e : number
|
||||
>[1, 2] : [number, number]
|
||||
>1 : number
|
||||
>2 : number
|
||||
|
||||
9
tests/cases/compiler/es6modulekindWithES5Target10.ts
Normal file
9
tests/cases/compiler/es6modulekindWithES5Target10.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// @target: es5
|
||||
// @module: es2015
|
||||
|
||||
import i = require("mod"); // Error;
|
||||
|
||||
|
||||
namespace N {
|
||||
}
|
||||
export = N; // Error
|
||||
16
tests/cases/compiler/es6modulekindWithES5Target9.ts
Normal file
16
tests/cases/compiler/es6modulekindWithES5Target9.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// @target: es5
|
||||
// @module: es2015
|
||||
|
||||
import d from "mod";
|
||||
|
||||
import {a} from "mod";
|
||||
|
||||
import * as M from "mod";
|
||||
|
||||
export {a};
|
||||
|
||||
export * from "mod";
|
||||
|
||||
export {b} from "mod"
|
||||
|
||||
export default d;
|
||||
Reference in New Issue
Block a user