test(effect): add test for json methods (#371)
This commit is contained in:
parent
8c1638da33
commit
57276f9dcb
@ -515,6 +515,16 @@ describe('reactivity/effect', () => {
|
||||
expect(childSpy).toHaveBeenCalledTimes(5)
|
||||
})
|
||||
|
||||
it('should observe json methods', () => {
|
||||
let dummy = <Record<string, number>>{}
|
||||
const obj = reactive<Record<string, number>>({})
|
||||
effect(() => {
|
||||
dummy = JSON.parse(JSON.stringify(obj))
|
||||
})
|
||||
obj.a = 1
|
||||
expect(dummy.a).toBe(1)
|
||||
})
|
||||
|
||||
it('should observe class method invocations', () => {
|
||||
class Model {
|
||||
count: number
|
||||
|
Loading…
Reference in New Issue
Block a user