Skip to content

Instantly share code, notes, and snippets.

@if540
Last active July 8, 2020 03:54
Show Gist options
  • Save if540/fe2b858b0fc994795974a53c94646344 to your computer and use it in GitHub Desktop.
Save if540/fe2b858b0fc994795974a53c94646344 to your computer and use it in GitHub Desktop.
vue js plugin component template for install code
import Radio from './Radio'
import Gropu from './Group'
Radio.Gropu = Gropu
Radio.install = function(Vue) {
Vue.component(Radio.name, Radio
Vue.component(Radio.Group.name, Radio.Group)
}
export { Group }
export default Radio
import { shallowMount } from '@vue/test-utils'
import Radio from './Radio'
let wrapper = null
beforeEach(() => {
wrapper = shallowMount(Radio)
})
afterEach(() => {
wrapper.destroy()
})
describe('Radio component test', () => {
it('create', () => {
expect(wrapper.text()).toBe('hello radio jsx component test prop')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment