Vuejs2 Karma/Chai测试中的Vuelidate警告

Vuejs2 Karma/Chai测试中的Vuelidate警告,vuejs2,chai,Vuejs2,Chai,没什么大不了的,但这让我的测试有点难看。我正在使用Vuelidate处理数据验证,尽管我正在测试的渲染组件的控制台中没有错误,但我的Karma测试充满了以下内容: ERROR LOG: '[Vue warn]: Property or method "$v" is not defined on the instance but referenced during render Make sure to declare reactive data properties in the data op

没什么大不了的,但这让我的测试有点难看。我正在使用Vuelidate处理数据验证,尽管我正在测试的渲染组件的控制台中没有错误,但我的Karma测试充满了以下内容:

ERROR LOG: '[Vue warn]: Property or method "$v" is not defined on the
instance but referenced during render Make sure to declare reactive
data properties in the data option. (found in <Root>).'
错误日志:'[Vue warn]:未在上定义属性或方法“$v”
实例,但在渲染期间被引用。请确保声明被动
数据选项中的数据属性。(在中找到)。'

一切仍在运行,我只想清除错误。

将此介绍添加到您的测试文件中:

import Vuelidate from 'vuelidate'
Vue.use(Vuelidate)

您好,我的spec文件中也有相同的问题,但是在测试中使用Vue.use会出现以下错误:ReferenceError:Vue不是defined@harmoniuscool,在调用
Vue之前导入规范文件中的Vue。使用
方法
从“Vue”导入Vue