From c9651e1107ea245167d131473aeaee5bc611ab54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Wed, 14 Dec 2022 00:52:02 +0800 Subject: [PATCH] test: add --- .../__tests__/__snapshots__/compileScript.spec.ts.snap | 2 ++ packages/compiler-sfc/__tests__/compileScript.spec.ts | 8 ++++++++ 2 files changed, 10 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..879790e16fa 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -1619,6 +1619,8 @@ export default /*#__PURE__*/_defineComponent({ alias: { type: Array, required: true }, method: { type: Function, required: true }, symbol: { type: Symbol, required: true }, + extract: { type: Number, required: true }, + exclude: { type: [Number, Boolean], required: true }, objectOrFn: { type: [Function, Object], required: true }, union: { type: [String, Number], required: true }, literalUnion: { type: String, required: true }, diff --git a/packages/compiler-sfc/__tests__/compileScript.spec.ts b/packages/compiler-sfc/__tests__/compileScript.spec.ts index 7616c58f27b..5fb90b475e6 100644 --- a/packages/compiler-sfc/__tests__/compileScript.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript.spec.ts @@ -960,6 +960,8 @@ const emit = defineEmits(['a', 'b']) alias: Alias method(): void symbol: symbol + extract: Extract<1 | 2 | boolean, 2> + exclude: Exclude<1 | 2 | boolean, 2> objectOrFn: { (): void foo: string @@ -997,6 +999,10 @@ const emit = defineEmits(['a', 'b']) expect(content).toMatch( `objectOrFn: { type: [Function, Object], required: true },` ) + expect(content).toMatch(`extract: { type: Number, required: true }`) + expect(content).toMatch( + `exclude: { type: [Number, Boolean], required: true }` + ) expect(content).toMatch( `union: { type: [String, Number], required: true }` ) @@ -1031,6 +1037,8 @@ const emit = defineEmits(['a', 'b']) method: BindingTypes.PROPS, symbol: BindingTypes.PROPS, objectOrFn: BindingTypes.PROPS, + extract: BindingTypes.PROPS, + exclude: BindingTypes.PROPS, union: BindingTypes.PROPS, literalUnion: BindingTypes.PROPS, literalUnionNumber: BindingTypes.PROPS,