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 Jan 19, 2024
1 parent 67536ee commit 42391f4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/dts-test/setupHelpers.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,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 42391f4

Please sign in to comment.