])
})
+ test('on component with default slot and slot props', () => {
+ const onError = vi.fn()
+ parseWithSkipTransform(
+ `<Comp v-skip="ok">
+ <template #default="foo">foo</template>
+ </Comp>`,
+ { onError },
+ )
+ expect(onError.mock.calls[0]).toMatchObject([
+ {
+ code: ErrorCodes.X_V_SKIP_UNEXPECTED_SLOT,
+ },
+ ])
+ })
+
test('with v-for', () => {
const onError = vi.fn()
parseWithSkipTransform(`<div v-for="i in items" v-skip="ok"/>`, {
[ErrorCodes.X_VNODE_HOOKS]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
[ErrorCodes.X_V_SKIP_NO_EXPRESSION]: `v-skip is missing expression.`,
[ErrorCodes.X_V_SKIP_ON_TEMPLATE]: `v-skip cannot be used on <template> or <slot> tags.`,
- [ErrorCodes.X_V_SKIP_UNEXPECTED_SLOT]: `v-skip directive requires the component to have a default slot without slot props`,
+ [ErrorCodes.X_V_SKIP_UNEXPECTED_SLOT]: `v-skip requires the component to have a default slot without slot props`,
[ErrorCodes.X_V_SKIP_WITH_V_FOR]: `v-skip with v-for is not supported.`,
// generic errors