From 42391f43a2500ef269b4cfa9dabe0477375425ab Mon Sep 17 00:00:00 2001 From: yangchangtao Date: Fri, 19 Jan 2024 16:49:30 +0800 Subject: [PATCH] test(withdefaults): add test case --- packages/dts-test/setupHelpers.test-d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/dts-test/setupHelpers.test-d.ts b/packages/dts-test/setupHelpers.test-d.ts index c749e80a5c7..951d54b86f6 100644 --- a/packages/dts-test/setupHelpers.test-d.ts +++ b/packages/dts-test/setupHelpers.test-d.ts @@ -162,6 +162,19 @@ describe('withDefaults w/ boolean type', () => { expectType(res2.bool) }) +describe('withDefaults w/ defineProp type is different from the defaults type', () => { + const res1 = withDefaults( + defineProps<{ + bool?: boolean + }>(), + { bool: false, value: false }, + ) + expectType(res1.bool) + + // @ts-expect-error + res1.value +}) + describe('defineProps w/ runtime declaration', () => { // runtime declaration const props = defineProps({