import UserTest from './seed/user-test'
import { createLocalVue, shallowMount, mount } from '@vue/test-utils'
import Component from '../dist'
const user = UserTest.user;
const userToken = UserTest.userToken;
describe('======= Sanity My New Component =======', () => {
it('Should be sane', (done) => {
expect(true).toEqual(true)
done()
})
})
describe('===== Component', () => {
describe('----- Instance', () => {
const component = shallowMount(Component, {
provide() {
return {
$authInject1: () => userToken,
$authInject2: () => user,
}
}
})
it('should be a Vue instance', () => {
expect(component.isVueInstance()).toBeTruthy()
expect(typeof component.vm.currentLanguage).toBe('string')
expect(component.vm.testCount(1, 2)).toBe(3)
})
})
})
Created
March 3, 2020 04:14
-
-
Save romain130492/cc4eb8ed1b5477238f93abb9184dc59c to your computer and use it in GitHub Desktop.
Jest Inject and provide() method
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment