Skip to content

Commit 4281d7a

Browse files
committed
test: add falling test for tsconfig allowArbitraryExtensions option
1 parent f556c92 commit 4281d7a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,29 @@ describe('resolveType', () => {
14341434
colsLg: ['Number'],
14351435
})
14361436
})
1437+
1438+
test('allowArbitraryExtensions', () => {
1439+
const files = {
1440+
'/foo.d.vue.ts': 'export type Foo = number;',
1441+
'/foo.vue': '<template><div /></template>',
1442+
'/bar.d.css.ts': 'export type Bar = string;',
1443+
'/bar.css': ':root { --color: red; }',
1444+
}
1445+
1446+
const { props } = resolve(
1447+
`
1448+
import { Foo } from './foo.vue'
1449+
import { Bar } from './bar.css'
1450+
defineProps<{ foo: Foo; bar: Bar }>()
1451+
`,
1452+
files,
1453+
)
1454+
1455+
expect(props).toStrictEqual({
1456+
foo: ['Number'],
1457+
bar: ['String'],
1458+
})
1459+
})
14371460
})
14381461
})
14391462

0 commit comments

Comments
 (0)