When running unit tests with karma there are lots of warnings about unknown components that obstruct the relevant testing output. Looks like this:
ERROR LOG: '[Vue warn]: Unknown custom element: <md-card> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in <Root>)'
ERROR LOG: '[Vue warn]: Unknown custom element: <md-card-header> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in <Root>)'
ERROR LOG: '[Vue warn]: Unknown custom element: <md-card-content> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in <Root>)'
ERROR LOG: '[Vue warn]: Unknown custom element: <md-button> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in <Root>)'
ERROR LOG: '[Vue warn]: Unknown custom element: <md-icon> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in <Root>)'
ERROR LOG: '[Vue warn]: Unknown custom element: <md-card> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in <Root>)'
ERROR LOG: '[Vue warn]: Unknown custom element: <md-card-header> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in <Root>)'
ERROR LOG: '[Vue warn]: Unknown custom element: <md-card-content> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in <Root>)'
ERROR LOG: '[Vue warn]: Unknown custom element: <md-button> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in <Root>)'
ERROR LOG: '[Vue warn]: Unknown custom element: <md-icon> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in <Root>)'
Solution may possibly be adding name into the component definitions as mentioned in the warnings.
Vue: 2.2.2
Vue-material: 0.7.1
+1
@Samuell1 Please clarify where does the new version needs to be added.
@JakubPetriska i mean in some new version of vue was changed to component needs name if its recursively used, but this UI was before that version, and after new was not tested
Closing this issue as our focus is on the new 1.0.0 version.
@JakubPetriska It's not optimal, but how about scaffolding Vue Material globally on your test files, like so (using Jest below):
import Vue from 'vue'
import App from '@/App'
import VueMaterial from 'vue-material'
Vue.use(VueMaterial)
describe('App.vue', () => {
it('should render without crashing', () => {
const Constructor = Vue.extend(App)
const vm = new Constructor().$mount()
})
})
Most helpful comment
+1