Skip to content

Commit

Permalink
test: test case for sfc parse options cache invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 30, 2023
1 parent b8d58ec commit 274f6f7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/compiler-sfc/__tests__/parse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 274f6f7

Please sign in to comment.