Skip to content

Commit a5f962a

Browse files
committed
test(types): assert props are readonly
1 parent f2cdc82 commit a5f962a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test-dts/createComponent.test-d.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ describe('with object props', () => {
5050
expectType<ExpectedProps['ccc']>(props.ccc)
5151
expectType<ExpectedProps['ddd']>(props.ddd)
5252

53+
// props should be readonly
54+
expectError((props.a = 1))
55+
5356
// setup context
5457
return {
5558
c: ref(1),

0 commit comments

Comments
 (0)