diff --git a/packages/reactivity/__tests__/immutable.spec.ts b/packages/reactivity/__tests__/immutable.spec.ts index 49b2fa57..16889ebc 100644 --- a/packages/reactivity/__tests__/immutable.spec.ts +++ b/packages/reactivity/__tests__/immutable.spec.ts @@ -8,7 +8,8 @@ import { markImmutable, lock, unlock, - effect + effect, + ref } from '../src' describe('reactivity/immutable', () => { @@ -390,4 +391,11 @@ describe('reactivity/immutable', () => { expect(isImmutable(obj.foo)).toBe(false) expect(isImmutable(obj.bar)).toBe(true) }) + + test('should make ref immutable', () => { + const n: any = immutable(ref(1)) + n.value = 2 + expect(n.value).toBe(1) + expect(warn).toHaveBeenCalledTimes(1) + }) })