From b872fc39816b8dd7d090addef53451292e38752d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Thu, 22 Dec 2022 13:46:01 +0800 Subject: [PATCH] test: add --- .../__tests__/__snapshots__/compileScript.spec.ts.snap | 1 + packages/compiler-sfc/__tests__/compileScript.spec.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index 473ebd4e0b9..f20d16dda8d 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -1625,6 +1625,7 @@ export default /*#__PURE__*/_defineComponent({ literalUnionNumber: { type: Number, required: true }, literalUnionMixed: { type: [String, Number, Boolean], required: true }, intersection: { type: Object, required: true }, + intersection2: { type: String, required: true }, foo: { type: [Function, null], required: true } }, setup(__props: any, { expose }) { diff --git a/packages/compiler-sfc/__tests__/compileScript.spec.ts b/packages/compiler-sfc/__tests__/compileScript.spec.ts index 7616c58f27b..af4dcf21507 100644 --- a/packages/compiler-sfc/__tests__/compileScript.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript.spec.ts @@ -970,6 +970,7 @@ const emit = defineEmits(['a', 'b']) literalUnionNumber: 1 | 2 | 3 | 4 | 5 literalUnionMixed: 'foo' | 1 | boolean intersection: Test & {} + intersection2: 'foo' & ('foo' | 'bar') foo: ((item: any) => boolean) | null }>() `) @@ -1008,6 +1009,7 @@ const emit = defineEmits(['a', 'b']) `literalUnionMixed: { type: [String, Number, Boolean], required: true }` ) expect(content).toMatch(`intersection: { type: Object, required: true }`) + expect(content).toMatch(`intersection2: { type: String, required: true }`) expect(content).toMatch(`foo: { type: [Function, null], required: true }`) expect(bindings).toStrictEqual({ string: BindingTypes.PROPS, @@ -1036,6 +1038,7 @@ const emit = defineEmits(['a', 'b']) literalUnionNumber: BindingTypes.PROPS, literalUnionMixed: BindingTypes.PROPS, intersection: BindingTypes.PROPS, + intersection2: BindingTypes.PROPS, foo: BindingTypes.PROPS }) })