Skip to content

Commit 274f6f7

Browse files
committed
test: test case for sfc parse options cache invalidation
1 parent b8d58ec commit 274f6f7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/compiler-sfc/__tests__/parse.spec.ts

+12
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,18 @@ h1 { color: red }
367367
tag: 'hello',
368368
tagType: ElementTypes.ELEMENT,
369369
})
370+
371+
// test cache invalidation on different options
372+
const { descriptor: d2 } = parse(`<template><hello/></template>`, {
373+
templateParseOptions: {
374+
isCustomElement: t => t !== 'hello',
375+
},
376+
})
377+
expect(d2.template!.ast!.children[0]).toMatchObject({
378+
type: NodeTypes.ELEMENT,
379+
tag: 'hello',
380+
tagType: ElementTypes.COMPONENT,
381+
})
370382
})
371383

372384
describe('warnings', () => {

0 commit comments

Comments
 (0)