Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { mount } from '@vue/test-utils'
- import Component from '.'
- describe('Component', () => {
- describe('mounted', () => {
- let wrapper
- let spy
- beforeEach(() => {
- spy = jest.spyOn(Component.methods, 'methodToMock')
- wrapper = mount(Component)
- })
- afterEach(() => {
- spy.mockClear()
- })
- it('should call method methodToMock', () => {
- expect(spy).toHaveBeenCalled()
- })
- })
- })
Add Comment
Please, Sign In to add comment