From: Evan You Date: Sat, 30 Dec 2023 13:09:15 +0000 (+0800) Subject: test: test case for sfc parse options cache invalidation X-Git-Tag: v3.4.3~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=274f6f71fcc36eb4e3cdbaa65e2f4b98c013ec34;p=thirdparty%2Fvuejs%2Fcore.git test: test case for sfc parse options cache invalidation --- diff --git a/packages/compiler-sfc/__tests__/parse.spec.ts b/packages/compiler-sfc/__tests__/parse.spec.ts index 3d5ec8604b..048dab693a 100644 --- a/packages/compiler-sfc/__tests__/parse.spec.ts +++ b/packages/compiler-sfc/__tests__/parse.spec.ts @@ -367,6 +367,18 @@ h1 { color: red } tag: 'hello', tagType: ElementTypes.ELEMENT, }) + + // test cache invalidation on different options + const { descriptor: d2 } = parse(``, { + templateParseOptions: { + isCustomElement: t => t !== 'hello', + }, + }) + expect(d2.template!.ast!.children[0]).toMatchObject({ + type: NodeTypes.ELEMENT, + tag: 'hello', + tagType: ElementTypes.COMPONENT, + }) }) describe('warnings', () => {