Skip to content

Commit 1643f7c

Browse files
committed
add test for prop default with object spread
1 parent e681dfe commit 1643f7c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/lib/rules/require-default-prop.js

+28
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,34 @@ ruleTester.run('require-default-prop', rule, {
6868
}
6969
`,
7070
parserOptions
71+
},
72+
{
73+
filename: 'test.vue',
74+
code: `
75+
const x = {
76+
type: Object,
77+
default() {
78+
return {
79+
foo: 1,
80+
bar: 2
81+
}
82+
}
83+
}
84+
export default {
85+
props: {
86+
a: {
87+
...x,
88+
default() {
89+
return {
90+
...x.default(),
91+
baz: 3
92+
}
93+
}
94+
}
95+
}
96+
}
97+
`,
98+
parserOptions
7199
}
72100
],
73101

0 commit comments

Comments
 (0)