test: effect.onStop

This commit is contained in:
Evan You 2019-08-26 21:24:44 -04:00
parent a0bc525fee
commit cb3866890f

View File

@ -624,6 +624,15 @@ describe('reactivity/effect', () => {
expect(dummy).toBe(3) expect(dummy).toBe(3)
}) })
it('events: onStop', () => {
const runner = effect(() => {}, {
onStop: jest.fn()
})
stop(runner)
expect(runner.onStop).toHaveBeenCalled()
})
it('markNonReactive', () => { it('markNonReactive', () => {
const obj = reactive({ const obj = reactive({
foo: markNonReactive({ foo: markNonReactive({