gmlove / gmlove.github.io

Personal blog
3 stars 0 forks source link

jasmine.any 之坑 | Bright LGM's Blog #97

Open gmlove opened 1 year ago

gmlove commented 1 year ago

https://brightliao.com/2015/12/08/pitfall-jasmin-any/

坑说:Jasmine的any(Object)不能替代any({premitive type}),可以考虑使用anything() 坑位:使用toHaveBeenCalledWith测试函数被调用时的参数。 当参数列表太长(如:func(p1, p2, p3){...})的时候,往往只需要验证某一部分参数正确性,这个时候使用any()。