Last active
February 4, 2020 08:40
-
-
Save kahirokunn/a15c911cbad33082afb41cc861524c2d to your computer and use it in GitHub Desktop.
for issue
This file contains 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 { FunctionalComponentOptions } from 'vue' | |
import { shallowMount, createLocalVue } from '@vue/test-utils' | |
let localVue: ReturnType<typeof createLocalVue> | |
describe('test', () => { | |
beforeEach(() => { | |
localVue = createLocalVue() | |
}) | |
it('success mount', () => { | |
const functionalComponent: FunctionalComponentOptions<{ tag: string }> = { | |
functional: true, | |
props: { | |
tag: { | |
type: String, | |
default: 'div' | |
} | |
}, | |
render(h, { props: { tag } }) { | |
return h(tag) | |
} | |
} | |
const wrapper = shallowMount(functionalComponent, { localVue, propsData: { tag: 'p' } }) | |
expect(wrapper.html()).toMatchSnapshot(); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment