【发布时间】:2020-02-13 05:15:58
【问题描述】:
我有如下 vue 组件代码
updated: function() {
// set showPackages = true after all the child component render
this.$nextTick(function() {
this.show = this.element.show ? true : false
this.done = true
})
}
现在,我们要测试这个更新的钩子并检查 this.show 是否设置。
有人知道如何为这个生命周期钩子编写测试用例吗?
【问题讨论】:
标签: unit-testing vue.js jestjs vue-test-utils