chore: fix tests (#2120)
This commit is contained in:
parent
c67e78ab6f
commit
cdd849a09c
@ -1,7 +1,7 @@
|
|||||||
import MagicString from 'magic-string'
|
import MagicString from 'magic-string'
|
||||||
import { BindingMetadata } from '@vue/compiler-core'
|
import { BindingMetadata } from '@vue/compiler-core'
|
||||||
import { SFCDescriptor, SFCScriptBlock } from './parse'
|
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 { babelParserDefaultPlugins, generateCodeFrame } from '@vue/shared'
|
||||||
import {
|
import {
|
||||||
Node,
|
Node,
|
||||||
|
@ -24,7 +24,7 @@ describe('compiler + runtime integration', () => {
|
|||||||
mounted: jest.fn(),
|
mounted: jest.fn(),
|
||||||
activated: jest.fn(),
|
activated: jest.fn(),
|
||||||
deactivated: jest.fn(),
|
deactivated: jest.fn(),
|
||||||
destroyed: jest.fn()
|
unmounted: jest.fn()
|
||||||
}
|
}
|
||||||
|
|
||||||
const toggle = ref(true)
|
const toggle = ref(true)
|
||||||
@ -50,7 +50,7 @@ describe('compiler + runtime integration', () => {
|
|||||||
expect(one.mounted).toHaveBeenCalledTimes(1)
|
expect(one.mounted).toHaveBeenCalledTimes(1)
|
||||||
expect(one.activated).toHaveBeenCalledTimes(1)
|
expect(one.activated).toHaveBeenCalledTimes(1)
|
||||||
expect(one.deactivated).toHaveBeenCalledTimes(0)
|
expect(one.deactivated).toHaveBeenCalledTimes(0)
|
||||||
expect(one.destroyed).toHaveBeenCalledTimes(0)
|
expect(one.unmounted).toHaveBeenCalledTimes(0)
|
||||||
|
|
||||||
toggle.value = false
|
toggle.value = false
|
||||||
await nextTick()
|
await nextTick()
|
||||||
@ -59,7 +59,7 @@ describe('compiler + runtime integration', () => {
|
|||||||
expect(one.mounted).toHaveBeenCalledTimes(1)
|
expect(one.mounted).toHaveBeenCalledTimes(1)
|
||||||
expect(one.activated).toHaveBeenCalledTimes(1)
|
expect(one.activated).toHaveBeenCalledTimes(1)
|
||||||
expect(one.deactivated).toHaveBeenCalledTimes(1)
|
expect(one.deactivated).toHaveBeenCalledTimes(1)
|
||||||
expect(one.destroyed).toHaveBeenCalledTimes(0)
|
expect(one.unmounted).toHaveBeenCalledTimes(0)
|
||||||
|
|
||||||
toggle.value = true
|
toggle.value = true
|
||||||
await nextTick()
|
await nextTick()
|
||||||
@ -68,7 +68,7 @@ describe('compiler + runtime integration', () => {
|
|||||||
expect(one.mounted).toHaveBeenCalledTimes(1)
|
expect(one.mounted).toHaveBeenCalledTimes(1)
|
||||||
expect(one.activated).toHaveBeenCalledTimes(2)
|
expect(one.activated).toHaveBeenCalledTimes(2)
|
||||||
expect(one.deactivated).toHaveBeenCalledTimes(1)
|
expect(one.deactivated).toHaveBeenCalledTimes(1)
|
||||||
expect(one.destroyed).toHaveBeenCalledTimes(0)
|
expect(one.unmounted).toHaveBeenCalledTimes(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should support runtime template via CSS ID selector', () => {
|
it('should support runtime template via CSS ID selector', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user