export type CaseUnit<Param, Tobe> = {
func?: any
name?: string
param?: Param
params?: Param | Param[]
tobe?: _Tobe<Tobe>
tobes?: _Tobe<Tobe>[]
warningTobe?: _Tobe<Tobe>
warningTobes?: _Tobe<Tobe>[]
type?: CaseUnitType
paramType?: CaseUnitParamType
/**
* 测试执行前
*/
before?: callback<Param, Tobe>
/**
* 判断结果是否正确前
*/
beforeEqual?: callback<Param, Tobe>
/**
* 打印结果前
*/
after?: callback<Param, Tobe>
/**
* @title 超时时间
* @default 2000
*/
timeout?: number | 'Infinite'
run?: {
actual: any,
runTime: number,
error?: string
}
[key: string]: any
}
test(name, func, {...},{...}, ...)
// 可以打印出相应的结果