test: test immutable + ref
This commit is contained in:
parent
0aff144f93
commit
2777cd37b4
@ -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)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user