reactivity.test-d.ts 384 B

123456789101112131415
  1. import { ref, readonly, describe, expectError, expectType, Ref } from './index'
  2. describe('should support DeepReadonly', () => {
  3. const r = readonly({ obj: { k: 'v' } })
  4. // @ts-expect-error
  5. expectError((r.obj = {}))
  6. // @ts-expect-error
  7. expectError((r.obj.k = 'x'))
  8. })
  9. // #4180
  10. describe('readonly ref', () => {
  11. const r = readonly(ref({ count: 1 }))
  12. expectType<Ref>(r)
  13. })