We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f528512 commit 90ce57dCopy full SHA for 90ce57d
packages/@ember/template-compiler/type-tests/template.test.ts
@@ -1,6 +1,11 @@
1
import { template, type EmberPrecompileOptions } from '@ember/template-compiler';
2
+import type { TemplateOnlyComponent } from '@ember/component/template-only';
3
import { expectTypeOf } from 'expect-type';
4
-expectTypeOf(template).toEqualTypeOf<
5
- (template: string, options?: Partial<EmberPrecompileOptions>) => object
6
->();
+const hello = 'hello';
+
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