Skip to content

Commit c6841bd

Browse files
authored
test(compiler-sfc): add assertion for template functional (#11557)
1 parent f8ce86b commit c6841bd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/compiler-sfc/__tests__/parse.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,5 +425,15 @@ h1 { color: red }
425425
`At least one <template> or <script> is required in a single file component`,
426426
)
427427
})
428+
429+
test('should throw error if template functional is given', () => {
430+
assertWarning(
431+
parse(`<template functional></template>`).errors,
432+
`<template functional> is no longer supported in Vue 3, since ` +
433+
`functional components no longer have significant performance ` +
434+
`difference from stateful ones. Just use a normal <template> ` +
435+
`instead.`,
436+
)
437+
})
428438
})
429439
})

0 commit comments

Comments
 (0)