Pārlūkot izejas kodu

test(compiler-sfc): add assertion for template functional (#11557)

disservin 1 gadu atpakaļ
vecāks
revīzija
c6841bdf4e
1 mainītis faili ar 10 papildinājumiem un 0 dzēšanām
  1. 10 0
      packages/compiler-sfc/__tests__/parse.spec.ts

+ 10 - 0
packages/compiler-sfc/__tests__/parse.spec.ts

@@ -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.`,
+      )
+    })
   })
 })