【发布时间】:2020-09-01 05:47:41
【问题描述】:
如何测试以下方法的内部逻辑?
例如:
async method () {
this.isLoading = true;
await this.GET_OFFERS();
this.isLoading = false;
this.router.push("/somewhere");
}
所以我有了切换isLoading、调用动作并在某处路由的方法。我如何确定isLoading 已正确切换(在操作调用之前为true,之后为false)?
【问题讨论】:
标签: javascript unit-testing vue.js frontend vue-test-utils