Skip to content

Commit

Permalink
Type empty array before pushing to it
Browse files Browse the repository at this point in the history
  • Loading branch information
Peeja committed Oct 17, 2024
1 parent 0c5f794 commit aa28761
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/miniflare/freeway.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { Builder, toBlobKey } from '../helpers/builder.js'
import { generateBlockLocationClaims, mockClaimsService, generateLocationClaim } from '../helpers/content-claims.js'
import { mockBucketService } from '../helpers/bucket.js'

/** @import { Block, Position } from 'carstream' */

/**
* @param {{ arrayBuffer: () => Promise<ArrayBuffer> }} a
* @param {{ arrayBuffer: () => Promise<ArrayBuffer> }} b
Expand Down Expand Up @@ -163,6 +165,7 @@ describe('freeway', () => {
const source = /** @type {ReadableStream<Uint8Array>} */ (res.body)
const carStream = new CARReaderStream()

/** @type {(Block & Position)[]} */
const blocks = []
await source.pipeThrough(carStream).pipeTo(new WritableStream({
write: (block) => { blocks.push(block) }
Expand Down Expand Up @@ -221,6 +224,8 @@ describe('freeway', () => {
const source = /** @type {ReadableStream<Uint8Array>} */ (obj.body)
const carStream = new CARReaderStream()


/** @type {(Block & Position)[]} */
const blocks = []
await source.pipeThrough(carStream).pipeTo(new WritableStream({
write: (block) => { blocks.push(block) }
Expand Down

0 comments on commit aa28761

Please sign in to comment.