|
5 | 5 |
|
6 | 6 | import assert from 'assert' |
7 | 7 | import { toCollection } from '../../../shared/utilities/asyncCollection' |
8 | | -import { intoCollection } from '../../../shared/utilities/collectionUtils' |
9 | 8 |
|
10 | 9 | describe('AsyncCollection', function () { |
11 | 10 | const items = [ |
@@ -206,35 +205,6 @@ describe('AsyncCollection', function () { |
206 | 205 | assert.strictEqual(counter.callCount, 7) |
207 | 206 | }) |
208 | 207 |
|
209 | | - describe('batchedIterator', function () { |
210 | | - const items = [1, 2, 3, 4, 5, 6, 7, 8, 9] |
211 | | - const mixedItems = [1, '2', 3, '4', 5, '6'] |
212 | | - |
213 | | - it('can iterator batches at a time', async function () { |
214 | | - const batchedIterator = intoCollection(items).batchedIterator(3) |
215 | | - assert.deepStrictEqual((await batchedIterator.next()).value, [1, 2, 3], 'first batch') |
216 | | - assert.deepStrictEqual((await batchedIterator.next()).value, [4, 5, 6], 'second batch') |
217 | | - assert.deepStrictEqual((await batchedIterator.next()).value, [7, 8, 9], 'third batch') |
218 | | - assert.ok((await batchedIterator.next()).done) |
219 | | - }) |
220 | | - |
221 | | - it('can handle partial batches', async function () { |
222 | | - const batchedIterator = intoCollection(items).batchedIterator(4) |
223 | | - assert.deepStrictEqual((await batchedIterator.next()).value, [1, 2, 3, 4], 'first batch') |
224 | | - assert.deepStrictEqual((await batchedIterator.next()).value, [5, 6, 7, 8], 'second batch') |
225 | | - assert.deepStrictEqual((await batchedIterator.next()).value, [9], 'third batch') |
226 | | - assert.ok((await batchedIterator.next()).done) |
227 | | - }) |
228 | | - |
229 | | - it('can handle mixed valued batches', async function () { |
230 | | - const batchedIterator = intoCollection(mixedItems).batchedIterator(2) |
231 | | - assert.deepStrictEqual((await batchedIterator.next()).value, [1, '2'], 'first batch') |
232 | | - assert.deepStrictEqual((await batchedIterator.next()).value, [3, '4'], 'second batch') |
233 | | - assert.deepStrictEqual((await batchedIterator.next()).value, [5, '6'], 'third batch') |
234 | | - assert.ok((await batchedIterator.next()).done) |
235 | | - }) |
236 | | - }) |
237 | | - |
238 | 208 | describe('errors', function () { |
239 | 209 | async function* error() { |
240 | 210 | throw new Error() |
|
0 commit comments