我目前正在将大量测试从Mocha和Chai迁移到AVA。正因为如此,我有时不得不替换一些 Chai.js 断言才能在 AVA 中使用它们,例如:
// Before
expect(arr).to.be.iterable;
// After
t.is(typeof arr[Symbol.iterator], 'function');
但是,我不确定如何替换.我在 Chai 文档页面上找到了以下内容: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一起使用?
森栏
潇潇雨雨
随时随地看视频慕课网APP
相关分类