|
|
@@ -3,6 +3,14 @@ import { mockWarn } from '@vue/runtime-test'
|
|
|
|
|
|
describe('compiler:sfc', () => {
|
|
|
mockWarn()
|
|
|
+
|
|
|
+ test('should ignore nodes with no content', () => {
|
|
|
+ expect(parse(`<template/>`).template).toBe(null)
|
|
|
+ expect(parse(`<script/>`).script).toBe(null)
|
|
|
+ expect(parse(`<style/>`).styles.length).toBe(0)
|
|
|
+ expect(parse(`<custom/>`).customBlocks.length).toBe(0)
|
|
|
+ })
|
|
|
+
|
|
|
describe('error', () => {
|
|
|
test('should only allow single template element', () => {
|
|
|
parse(`<template><div/></template><template><div/></template>`)
|