Skip to content

Commit

Permalink
test(types): test for tsx style validation
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 1, 2021
1 parent 75fdcd8 commit 3f9906a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test-dts/tsx.test-d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ expectType<JSX.Element>(<div />)
expectType<JSX.Element>(<div id="foo" />)
expectType<JSX.Element>(<input value="foo" />)

// @ts-expect-error style css property validation
expectError(<div style={{ unknown: 123 }} />)

// allow array styles and nested array styles
expectType<JSX.Element>(<div style={[{ color: 'red' }]} />)
expectType<JSX.Element>(
<div style={[{ color: 'red' }, [{ fontSize: '1em' }]]} />
)

// @ts-expect-error unknown prop
expectError(<div foo="bar" />)

Expand Down

0 comments on commit 3f9906a

Please sign in to comment.