Skip to content

Commit

Permalink
Fix chunkPost tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-senechal committed Sep 24, 2024
1 parent a71163e commit d46387f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cli/tests/chunkPost.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ describe('ChunkPost', () => {
const filePath = 'test.txt'
const chunkId = 1n
const data = new Uint8Array([1, 2, 3, 4])
const totalChunks = 5n

const chunkPost = new ChunkPost(filePath, chunkId, data, totalChunks)
const chunkPost = new ChunkPost(filePath, chunkId, data)
const serialized = chunkPost.serialize()
const deserializedResult = new ChunkPost().deserialize(serialized, 0)
const deserialized = deserializedResult.instance

expect(deserialized.filePath).toBe(filePath)
expect(deserialized.chunkId).toBe(chunkId)
expect(deserialized.data).toEqual(data)
expect(deserialized.totalChunks).toBe(totalChunks)
})
})

Expand All @@ -29,11 +27,9 @@ describe('toChunkPosts', () => {
expect(chunkPosts[0].filePath).toBe(filePath)
expect(chunkPosts[0].chunkId).toBe(0n)
expect(chunkPosts[0].data).toEqual(chunks[0])
expect(chunkPosts[0].totalChunks).toBe(2n)

expect(chunkPosts[1].filePath).toBe(filePath)
expect(chunkPosts[1].chunkId).toBe(1n)
expect(chunkPosts[1].data).toEqual(chunks[1])
expect(chunkPosts[1].totalChunks).toBe(2n)
})
})

0 comments on commit d46387f

Please sign in to comment.