Skip to content

Commit 886a29b

Browse files
Added tests for import helpers with & without a declared template object creator.
1 parent 1cb5eb9 commit 886a29b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/cases/compiler/importHelpers.ts

100644100755
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ class C {
1616
}
1717
}
1818

19+
function id<T>(x: T) {
20+
return x;
21+
}
22+
23+
export const result = id`hello world`;
24+
1925
// @filename: script.ts
2026
class A { }
2127
class B extends A { }
@@ -28,10 +34,17 @@ class C {
2834
}
2935
}
3036

37+
function id<T>(x: T) {
38+
return x;
39+
}
40+
41+
const result = id`hello world`;
42+
3143
// @filename: tslib.d.ts
3244
export declare function __extends(d: Function, b: Function): void;
3345
export declare function __assign(t: any, ...sources: any[]): any;
3446
export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;
3547
export declare function __param(paramIndex: number, decorator: Function): Function;
3648
export declare function __metadata(metadataKey: any, metadataValue: any): Function;
3749
export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;
50+
export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// @target: es5
2+
// @module: commonjs
3+
// @importHelpers: true
4+
// @strict: true
5+
6+
// @filename: foo.ts
7+
function id<T>(x: T) {
8+
return x;
9+
}
10+
11+
export const result = id `hello world`;
12+
13+
// @filename: ./node_modules/tslib/index.d.ts
14+
export { };

0 commit comments

Comments
 (0)