vue-tests icon indicating copy to clipboard operation
vue-tests copied to clipboard

add test unit contant i18n

Open mgbq opened this issue 7 years ago • 2 comments

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) 也是报这个错,百忙中求解答

mgbq avatar May 25 '18 06:05 mgbq

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

lilyrae avatar May 30 '18 16:05 lilyrae

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

mgbq avatar May 31 '18 02:05 mgbq