我正在尝试单元测试一个组件方法。问题没有说明如何从单元测试中访问组件方法。
具体来说,鉴于下面的Vue组件,我如何从单元测试中访问doSomeWork()?
Vue组件:
<template>
<div id="ThisStuff">
<span>
Some other stuff is going on here
</span>
</div>
</template>
<script>
import foo fro
我正在为angular应用程序运行单元测试,我想要单元测试导航是否在angular应用程序中正常工作。
if (this.customer.length == 0) {
this.router.navigate(['/nocustomer']);
}
以及为此进行的单元测试
it(`should navigate to nocustomer`,()=>{
component.customers.length=0;
//what must be written here to check this
})
我希望在我的单元测试中跳过某个语句,例如:
if (MessageBox.Show("Are you sure you want to remove " + contact.CompanyName + " from the contacts?", "Confirm Delete", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.Yes)
有没有一个属性可以放在语句的上方,以避免单元测试执行它?