test: test case for sfc parse options cache invalidation

This commit is contained in:
Evan You 2023-12-30 21:09:15 +08:00
parent b8d58ec4f4
commit 274f6f71fc
1 changed files with 12 additions and 0 deletions

View File

@ -367,6 +367,18 @@ h1 { color: red }
tag: 'hello',
tagType: ElementTypes.ELEMENT,
})
// test cache invalidation on different options
const { descriptor: d2 } = parse(`<template><hello/></template>`, {
templateParseOptions: {
isCustomElement: t => t !== 'hello',
},
})
expect(d2.template!.ast!.children[0]).toMatchObject({
type: NodeTypes.ELEMENT,
tag: 'hello',
tagType: ElementTypes.COMPONENT,
})
})
describe('warnings', () => {