|
|
@@ -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)
|
|
|
+ })
|
|
|
})
|