diff --git a/packages/upload-client/src/car.js b/packages/upload-client/src/car.js index 2749da4ee..34c734309 100644 --- a/packages/upload-client/src/car.js +++ b/packages/upload-client/src/car.js @@ -42,16 +42,6 @@ export class BlockStream extends ReadableStream { let blocksPromise = null const getBlocksIterable = () => { if (blocksPromise) return blocksPromise - // FIXME: remove when resolved: https://github.com/nodejs/node/issues/48916 - /* c8 ignore next 10 */ - if (parseInt(globalThis.process?.versions?.node) > 18) { - blocksPromise = (async () => { - // @ts-expect-error - const bytes = await car.arrayBuffer() - return CarBlockIterator.fromBytes(new Uint8Array(bytes)) - })() - return blocksPromise - } blocksPromise = CarBlockIterator.fromIterable(toIterable(car.stream())) return blocksPromise } diff --git a/packages/upload-client/test/store.test.js b/packages/upload-client/test/store.test.js index 11b348f34..65ac1b9e3 100644 --- a/packages/upload-client/test/store.test.js +++ b/packages/upload-client/test/store.test.js @@ -59,7 +59,7 @@ describe('Store.add', () => { channel: server, }) - let progressStatusCalls = 0 + let loaded = 0 const carCID = await Store.add( { issuer: agent, with: space.did(), proofs, audience: serviceSigner }, car, @@ -67,14 +67,14 @@ describe('Store.add', () => { connection, onUploadProgress: (status) => { assert(typeof status.loaded === 'number' && status.loaded > 0) - progressStatusCalls++ + loaded = status.loaded }, } ) assert(service.store.add.called) assert.equal(service.store.add.callCount, 1) - assert.equal(progressStatusCalls, 1) + assert.equal(loaded, 225) assert(carCID) assert.equal(carCID.toString(), car.cid.toString())