Last active
May 5, 2019 01:59
-
-
Save achhunna/3188e0cc1de7b78a0ec6aaa256f42e54 to your computer and use it in GitHub Desktop.
Jest test template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { shallowMount } from '@vue/test-utils'; | |
import Component from './component'; // name of your Vue component | |
let wrapper; | |
beforeEach(() => { | |
wrapper = shallowMount(Component, { | |
propsData: {}, | |
mocks: {}, | |
stubs: {}, | |
methods: {}, | |
}); | |
}); | |
afterEach(() => { | |
wrapper.destroy(); | |
}); | |
describe('Component', () => { | |
test('is a Vue instance', () => { | |
expect(wrapper.isVueInstance).toBeTruthy(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment