🙆

[Vue warn]: Unknown custom element: <v-なんとか>の対処法

2022/11/29に公開

発端

筆者は以下の警告に遭遇しました

[Vue warn]: Unknown custom element: <v-list> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

結論

file: jest.config.js

module.exports = {
  // ... 
  setupFiles: ['./test/setup.js'], // <- add this
}

file: ./test/setup.js

import Vue from 'vue'
import Vuetify from 'vuetify'

Vue.use(Vuetify)

参考文献

https://github.com/vuejs/vue-test-utils/issues/1459

Discussion

ログインするとコメントできます