]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test(compiler-sfc): add assertion for template functional (#11557)
authordisservin <disservin.social@gmail.com>
Thu, 8 Aug 2024 13:08:58 +0000 (15:08 +0200)
committerGitHub <noreply@github.com>
Thu, 8 Aug 2024 13:08:58 +0000 (21:08 +0800)
packages/compiler-sfc/__tests__/parse.spec.ts

index 048dab693aa85569b23b80d2293bc6cb468eb5bd..87cd05ed0efe606006bf9b23e480ea16bdf35a98 100644 (file)
@@ -425,5 +425,15 @@ h1 { color: red }
         `At least one <template> or <script> is required in a single file component`,
       )
     })
+
+    test('should throw error if template functional is given', () => {
+      assertWarning(
+        parse(`<template functional></template>`).errors,
+        `<template functional> is no longer supported in Vue 3, since ` +
+          `functional components no longer have significant performance ` +
+          `difference from stateful ones. Just use a normal <template> ` +
+          `instead.`,
+      )
+    })
   })
 })