Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是一种在发生错误时调用函数的方法吗?
我有一个这样的测试:
t.true(ARRAY.every(function(item){ return item.label }), 'Every item should have label')
所以我正在寻找一个回调来指定在失败的情况下哪个项目没有标签。
有人在磁带 github 上给了我一个替代方案:
every 用于将数组简化为布尔值时,这不适合测试(并获取有意义的失败消息)数组中的每个项目。
磁带问题