2
0
Evan You 6 жил өмнө
parent
commit
cb3866890f

+ 9 - 0
packages/reactivity/__tests__/effect.spec.ts

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