Skip to content

Commit dc7ca1b

Browse files
committed
test: add props test
1 parent 2d70496 commit dc7ca1b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/specs/props.test.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ describe('props test', () => {
5252
});
5353

5454

55+
it('defineNameOnlyProps.vue', () => {
56+
const filename = 'propsTest/defineNameOnlyProps';
57+
const declaration = getImportDeclarationTree(join(fixturesDir, `${filename}.vue`), [], true);
58+
59+
expect(declaration).toStrictEqual({
60+
name: `/test/fixture/${filename}.vue`,
61+
props: ['foo'],
62+
size: 222,
63+
lastModifiedTime: 0,
64+
children: [],
65+
});
66+
});
67+
68+
5569
it('defineTwoProps.vue', () => {
5670
const filename = 'propsTest/defineTwoProps';
5771
const declaration = getImportDeclarationTree(join(fixturesDir, `${filename}.vue`), [], true);
@@ -94,6 +108,24 @@ describe('props test', () => {
94108
});
95109

96110

111+
112+
it('defineTypeOnlyPropsVariables.vue', () => {
113+
const filename = 'propsTest/defineTypeOnlyPropsVariables';
114+
const declaration = getImportDeclarationTree(join(fixturesDir, `${filename}.vue`), [], true);
115+
116+
expect(declaration).toStrictEqual({
117+
name: `/test/fixture/${filename}.vue`,
118+
props: {
119+
title: 'String',
120+
likes: 'Number',
121+
},
122+
size: 112,
123+
lastModifiedTime: 0,
124+
children: [],
125+
});
126+
});
127+
128+
97129
it('defineTypeOnlyPropsWithTypeScript.vue', () => {
98130
const filename = 'propsTest/defineTypeOnlyPropsWithTypeScript';
99131
const declaration = getImportDeclarationTree(join(fixturesDir, `${filename}.vue`), [], true);

0 commit comments

Comments
 (0)