我怎样才能运行测试时显示所有故障。
test('test case', async (t) => ){
await t.expect(1).eql(2);
await t.expect(3).eql(4);
}
我得到什么(第一次失败,然后停止):
1)的AssertionError:预期 '1' 到深等于 '2'
我想(所有错误数据):
1)的AssertionError:预期 '1' 到深等于 '2'
1)的AssertionError:预期 '3' 到深等于 '4'
这将工作,只是把所有的元素数组,并遍历它们
for(let i = 0; i < 400; i++) {
test
(`Test `+i, async t => {
await t.expect(i).eql(i+1);
});
}
真棒,这工作。感谢冰山Stiks)
let x = 0;
for (let i in result1){
if (result1[i] != result2[i]){
x += 1;
console.log( x +') AssertionError: expected ' + result1[i] + ' to deeply equal ' + result2[i] );
}
}
await t.expect(x).eql(0);