Skip to content

Commit 3038cd4

Browse files
committed
Fix a typo in chunk tests. Small improvements for chunk tests
1 parent b27151a commit 3038cd4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/util/chunk.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ test("Copies the whole value if the size is less <= MAX_CHUNK_SIZE", t => {
1111
t.is(chunks.length, 1)
1212
})
1313

14-
test("Splits value if the size evenly is MAX_CHUNK_SIZE * n", t => {
15-
const view = new Uint8Array(MAX_CHUNK_SIZE * 2)
14+
test("Splits value evenly if the size is MAX_CHUNK_SIZE * multiplier", t => {
15+
const multiplier = 2
16+
const view = new Uint8Array(MAX_CHUNK_SIZE * multiplier)
1617
const chunks = Array.from(chunk(view))
1718

1819
t.true(chunks.every(ch => ch.byteLength === MAX_CHUNK_SIZE))
19-
t.is(chunks.length, 2)
20+
t.is(chunks.length, multiplier)
2021
})
2122

2223
test("The size of the last chunk can be < MAX_CHUNK_SIZE", t => {

0 commit comments

Comments
 (0)