From 51342ee7a04e1fb88539e8d9037125cee88cce5b 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 cbe511f1d07..28e7aded02a 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -1608,6 +1608,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 3ea7632f68b..ae765457c65 100644 --- a/packages/compiler-sfc/__tests__/compileScript.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript.spec.ts @@ -904,6 +904,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 }>() `) @@ -939,6 +940,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, @@ -966,6 +968,7 @@ const emit = defineEmits(['a', 'b']) literalUnionNumber: BindingTypes.PROPS, literalUnionMixed: BindingTypes.PROPS, intersection: BindingTypes.PROPS, + intersection2: BindingTypes.PROPS, foo: BindingTypes.PROPS }) })