import MagicString from 'magic-string'
import { BindingMetadata } from '@vue/compiler-core'
import { SFCDescriptor, SFCScriptBlock } from './parse'
-import { parse, ParserPlugin, ParserOptions } from '@babel/parser'
+import { parse, ParserPlugin } from '@babel/parser'
import { babelParserDefaultPlugins, generateCodeFrame } from '@vue/shared'
import {
Node,
mounted: jest.fn(),
activated: jest.fn(),
deactivated: jest.fn(),
- destroyed: jest.fn()
+ unmounted: jest.fn()
}
const toggle = ref(true)
expect(one.mounted).toHaveBeenCalledTimes(1)
expect(one.activated).toHaveBeenCalledTimes(1)
expect(one.deactivated).toHaveBeenCalledTimes(0)
- expect(one.destroyed).toHaveBeenCalledTimes(0)
+ expect(one.unmounted).toHaveBeenCalledTimes(0)
toggle.value = false
await nextTick()
expect(one.mounted).toHaveBeenCalledTimes(1)
expect(one.activated).toHaveBeenCalledTimes(1)
expect(one.deactivated).toHaveBeenCalledTimes(1)
- expect(one.destroyed).toHaveBeenCalledTimes(0)
+ expect(one.unmounted).toHaveBeenCalledTimes(0)
toggle.value = true
await nextTick()
expect(one.mounted).toHaveBeenCalledTimes(1)
expect(one.activated).toHaveBeenCalledTimes(2)
expect(one.deactivated).toHaveBeenCalledTimes(1)
- expect(one.destroyed).toHaveBeenCalledTimes(0)
+ expect(one.unmounted).toHaveBeenCalledTimes(0)
})
it('should support runtime template via CSS ID selector', () => {