Skip to content

Commit e678c1b

Browse files
committed
Add test for satisfies
1 parent 0128be0 commit e678c1b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test-packages/package-test-core/__tests__/transform/rewrite.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,30 @@ describe('Transform: rewriteModule', () => {
3232
`);
3333
});
3434

35+
test('handles satisfies', () => {
36+
let script = {
37+
filename: 'test.gts',
38+
contents: [
39+
`import type { TOC } from '@ember/component/template-only';`,
40+
``,
41+
`const SmolComp = `,
42+
` <template>`,
43+
` Hello there, {{@name}}`,
44+
` <template> satisfies TOC<{ Args: { name: string }}>;`,
45+
``,
46+
`<template>`,
47+
` <SmolComp @name="Ember" />`,
48+
`</template>`,
49+
``,
50+
].join('\n'),
51+
};
52+
53+
let transformedModule = rewriteModule(ts, { script }, emberTemplateImportsEnvironment);
54+
55+
expect(transformedModule?.errors).toEqual([]);
56+
expect(transformedModule?.transformedContents).toMatchInlineSnapshot();
57+
});
58+
3559
test('handles the $ character', () => {
3660
let script = {
3761
filename: 'test.gts',

0 commit comments

Comments
 (0)