磁带测试失败时的回调
Callback when test fails with tape
是否可以在出错时调用函数?
我有一个这样的测试:
t.true(ARRAY.every(function(item){
return item.label
}), 'Every item should have label')
所以我正在寻找一个回调来指定在失败的情况下哪个项目没有标签。
有人在磁带上给了我一个备选方案github:
every is for when you want to reduce an array to a boolean, which isn't appropriate for testing (and getting a meaningful failure message) every item in an array.
是否可以在出错时调用函数?
我有一个这样的测试:
t.true(ARRAY.every(function(item){
return item.label
}), 'Every item should have label')
所以我正在寻找一个回调来指定在失败的情况下哪个项目没有标签。
有人在磁带上给了我一个备选方案github:
every is for when you want to reduce an array to a boolean, which isn't appropriate for testing (and getting a meaningful failure message) every item in an array.