Added tests for import helpers with & without a declared template object creator.

This commit is contained in:
Daniel Rosenwasser 2017-09-25 18:36:07 -07:00
parent 1cb5eb9685
commit 886a29b512
2 changed files with 27 additions and 0 deletions

13
tests/cases/compiler/importHelpers.ts Normal file → Executable file
View file

@ -16,6 +16,12 @@ class C {
}
}
function id<T>(x: T) {
return x;
}
export const result = id`hello world`;
// @filename: script.ts
class A { }
class B extends A { }
@ -28,6 +34,12 @@ class C {
}
}
function id<T>(x: T) {
return x;
}
const result = id`hello world`;
// @filename: tslib.d.ts
export declare function __extends(d: Function, b: Function): void;
export declare function __assign(t: any, ...sources: any[]): any;
@ -35,3 +47,4 @@ export declare function __decorate(decorators: Function[], target: any, key?: st
export declare function __param(paramIndex: number, decorator: Function): Function;
export declare function __metadata(metadataKey: any, metadataValue: any): Function;
export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;
export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;

View file

@ -0,0 +1,14 @@
// @target: es5
// @module: commonjs
// @importHelpers: true
// @strict: true
// @filename: foo.ts
function id<T>(x: T) {
return x;
}
export const result = id `hello world`;
// @filename: ./node_modules/tslib/index.d.ts
export { };