Skip to content

Commit 90ce57d

Browse files
committed
Start writing better type tests
1 parent f528512 commit 90ce57d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { template, type EmberPrecompileOptions } from '@ember/template-compiler';
2+
import type { TemplateOnlyComponent } from '@ember/component/template-only';
23
import { expectTypeOf } from 'expect-type';
34

4-
expectTypeOf(template).toEqualTypeOf<
5-
(template: string, options?: Partial<EmberPrecompileOptions>) => object
6-
>();
5+
const hello = 'hello';
6+
7+
expectTypeOf(template('hello world')).toEqualTypeOf<TemplateOnlyComponent>();
8+
expectTypeOf(template('hello world', { scope: () => ({}) })).toEqualTypeOf<TemplateOnlyComponent>();
9+
expectTypeOf(
10+
template('{{hello}} world', { scope: () => ({ hello }) })
11+
).toEqualTypeOf<TemplateOnlyComponent>();

0 commit comments

Comments
 (0)