我目前正在將大量測試從Mocha和Chai遷移到AVA。正因為如此,我有時不得不替換一些 Chai.js 斷言才能在 AVA 中使用它們,例如:// Beforeexpect(arr).to.be.iterable;// Aftert.is(typeof arr[Symbol.iterator], 'function');但是,我不確定如何替換.我在 Chai 文檔頁面上找到了以下內(nèi)容:expect(arr)to.deep.iterate.over([])In many cases the array spread operator is the best way to test iterables. chai-iterator is however very useful for testing part of a very long (or infinite) iterable.不幸的是,鏈接的頁面返回404。所以我的問題是 - 我如何替換上面的方法,以便我可以將其與AVA一起使用?
如何在AVA中替換Chai.js的“.deep.iterate.over”?
森欄
2022-09-02 20:54:01