test: test immutable + ref
This commit is contained in:
parent
0aff144f93
commit
2777cd37b4
@ -8,7 +8,8 @@ import {
|
|||||||
markImmutable,
|
markImmutable,
|
||||||
lock,
|
lock,
|
||||||
unlock,
|
unlock,
|
||||||
effect
|
effect,
|
||||||
|
ref
|
||||||
} from '../src'
|
} from '../src'
|
||||||
|
|
||||||
describe('reactivity/immutable', () => {
|
describe('reactivity/immutable', () => {
|
||||||
@ -390,4 +391,11 @@ describe('reactivity/immutable', () => {
|
|||||||
expect(isImmutable(obj.foo)).toBe(false)
|
expect(isImmutable(obj.foo)).toBe(false)
|
||||||
expect(isImmutable(obj.bar)).toBe(true)
|
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)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user