Skip to content

Commit

Permalink
test(withdefaults): add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchangtao committed Aug 16, 2024
1 parent 9754321 commit 661681e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages-private/dts-test/setupHelpers.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,19 @@ describe('withDefaults w/ boolean type', () => {
expectType<boolean | undefined>(res2.bool)
})

describe('withDefaults w/ defineProp type is different from the defaults type', () => {
const res1 = withDefaults(
defineProps<{
bool?: boolean
}>(),
{ bool: false, value: false },
)
expectType<boolean>(res1.bool)

// @ts-expect-error
res1.value
})

describe('defineProps w/ runtime declaration', () => {
// runtime declaration
const props = defineProps({
Expand Down

0 comments on commit 661681e

Please sign in to comment.