Added tests for import helpers with & without a declared template object creator.
This commit is contained in:
parent
1cb5eb9685
commit
886a29b512
13
tests/cases/compiler/importHelpers.ts
Normal file → Executable file
13
tests/cases/compiler/importHelpers.ts
Normal file → Executable 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;
|
||||
|
|
14
tests/cases/compiler/taggedTemplateWithoutDeclaredHelper.ts
Executable file
14
tests/cases/compiler/taggedTemplateWithoutDeclaredHelper.ts
Executable 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 { };
|
Loading…
Reference in a new issue