expect(doubled).toBe(undefined)
})
- it('should fire onDispose hook', () => {
+ it('should fire onScopeDispose hook', () => {
let dummy = 0
const scope = new EffectScope()
expect(dummy).toBe(7)
})
- it('should warn onDispose() is called when there is no active effect scope', () => {
+ it('should warn onScopeDispose() is called when there is no active effect scope', () => {
const spy = jest.fn()
const scope = new EffectScope()
scope.run(() => {
onScopeDispose(spy)
expect(
- '[Vue warn] onDispose() is called when there is no active effect scope to be associated with.'
+ '[Vue warn] onScopeDispose() is called when there is no active effect scope to be associated with.'
).toHaveBeenWarned()
scope.stop()
activeEffectScope.cleanups.push(fn)
} else if (__DEV__) {
warn(
- `onDispose() is called when there is no active effect scope` +
+ `onScopeDispose() is called when there is no active effect scope` +
` to be associated with.`
)
}