Vue-material: [core] Lots of warning when running unit tests

Created on 21 Apr 2017  路  5Comments  路  Source: vuematerial/vue-material

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

help wanted improvement

Most helpful comment

+1

All 5 comments

+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()
  })
})
Was this page helpful?
0 / 5 - 0 ratings

Related issues

xinzhanguo picture xinzhanguo  路  3Comments

andreujuanc picture andreujuanc  路  3Comments

capttrousers picture capttrousers  路  3Comments

Leshgan picture Leshgan  路  3Comments

delueg picture delueg  路  3Comments