I\'ve been working with vuejs and bootstrap-vue lately. Decided to add unit testing to my project.
I\'m not realy familiar with unit testing so I\'m trying anything I cou
There are two options for this.
Firstly, If you use localVue
instance you have to register your bootstrap-vue component as global object using this localVue.component("b-breadcrumb", BBreadcrumb)
I will mention to
b-breadcrumb
as if it any part of boostrap-vue's components.
const localVue = createLocalVue()
localVue.component("b-breadcrumb", BBreadcrumb)
mount(CustomComponent, {
// Some options
})
Secondly, If you don't use localVue
instance you can register this component as a param of mount method like this
mount(CustomComponent, {
// Some options
components: {
BBreadcrumb
},
})
There is a important issue that If you use
localVue
instance components option of mount method will not work.
Also you can ignore any bootstrap-vue component to avoid unneccessary rendering using stubs
option of mount method.
mount(CustomComponent, {
stubs: ["b-breadcrumb"]
})
More information about options of mount here