lilyrae / vue-tests

A simple unit test for a list component in Vue JS.
52 stars 19 forks source link

add test unit contant i18n #2

Open mgbq opened 6 years ago

mgbq commented 6 years ago

Hi Lily, Sorry to contact you here, couldn’t find you elsewhere. I read your article on Vue unit testing, and really like it.

,我参考了你的vue单元测试博客,你的demo没有使用i18n国际化,我的有使用,并且我是这样引入i18n的 import i18n from '@/lang' Vue.use(Element, { size: 'medium', // set element-ui default size i18n: (key, value) => i18n.t(key, value) })

可是它报错了 信息为 ERROR LOG: TypeError: undefined is not an object (evaluating 'i18n._t') 改成 import i18n from '@/lang' Vue.use(i18n) 也是报这个错,百忙中求解答

lilyrae commented 6 years ago

Hi @mgbq , Thanks, I'm glad you enjoyed it! :smiley: Is this a problem you're having when trying to make a unit test?

mgbq commented 6 years ago

Thank you for your answer,I have solved it,Is there any good project or information about unit tests for vue?