|
@@ -268,7 +268,9 @@ h1 { color: red }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
test('treat custom blocks as raw text', () => {
|
|
test('treat custom blocks as raw text', () => {
|
|
|
- const { errors, descriptor } = parse(`<foo> <-& </foo>`)
|
|
|
|
|
|
|
+ const { errors, descriptor } = parse(
|
|
|
|
|
+ `<template><input></template><foo> <-& </foo>`
|
|
|
|
|
+ )
|
|
|
expect(errors.length).toBe(0)
|
|
expect(errors.length).toBe(0)
|
|
|
expect(descriptor.customBlocks[0].content).toBe(` <-& `)
|
|
expect(descriptor.customBlocks[0].content).toBe(` <-& `)
|
|
|
})
|
|
})
|
|
@@ -309,5 +311,13 @@ h1 { color: red }
|
|
|
).errors.length
|
|
).errors.length
|
|
|
).toBe(0)
|
|
).toBe(0)
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+ // # 6676
|
|
|
|
|
+ test('should throw error if no <template> or <script> is present', () => {
|
|
|
|
|
+ assertWarning(
|
|
|
|
|
+ parse(`import { ref } from 'vue'`).errors,
|
|
|
|
|
+ `At least one <template> or <script> is required in a single file component`
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|