Sfoglia il codice sorgente

test(types): assert props are readonly

Evan You 6 anni fa
parent
commit
a5f962ab8e
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      test-dts/createComponent.test-d.tsx

+ 3 - 0
test-dts/createComponent.test-d.tsx

@@ -50,6 +50,9 @@ describe('with object props', () => {
       expectType<ExpectedProps['ccc']>(props.ccc)
       expectType<ExpectedProps['ddd']>(props.ddd)
 
+      // props should be readonly
+      expectError((props.a = 1))
+
       // setup context
       return {
         c: ref(1),