Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pikax committed Oct 21, 2023
1 parent b026360 commit 1e39ef2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/dts-test/componentTypeExtensions.test-d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const Custom = defineComponent({
expectType<JSX.Element>(<Custom baz={1} />)
expectType<JSX.Element>(<Custom custom={1} baz={1} />)
expectType<JSX.Element>(<Custom bar="bar" baz={1} />)
// @ts-expect-error cannot be string #3455
expectType<JSX.Element>(<Custom ref={''} bar="bar" baz={1} />)

// @ts-expect-error
Expand Down
2 changes: 1 addition & 1 deletion packages/dts-test/defineComponent.test-d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ describe('with object props', () => {
style={{ color: 'red' }}
// should allow key
key={'foo'}
// should allow ref
// @ts-expect-error cannot be string #3455
ref={'foo'}
ref_for={true}
/>
Expand Down
1 change: 1 addition & 0 deletions packages/dts-test/functionalComponent.test-d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const Foo = (props: { foo: number }) => h(Text, null, props.foo)
// TSX
expectType<JSX.Element>(<Foo foo={1} />)
expectType<JSX.Element>(<Foo foo={1} key="1" />)
// @ts-expect-error should allow ref
expectType<JSX.Element>(<Foo foo={1} ref="ref" />)
// @ts-expect-error
;<Foo />
Expand Down

0 comments on commit 1e39ef2

Please sign in to comment.