Skip to content

Commit 5582bfd

Browse files
committed
test: fix zipExtractor test BlobPart typing
1 parent 241fad4 commit 5582bfd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/utils/__tests__/zipExtractor.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ vi.mock('@tauri-apps/api/core', () => ({
77

88
import { extractZipContent } from '../zipExtractor'
99

10+
const toArrayBuffer = (bytes: Uint8Array): ArrayBuffer => {
11+
const copy = new Uint8Array(bytes.byteLength)
12+
copy.set(bytes)
13+
return copy.buffer
14+
}
15+
1016
describe('extractZipContent', () => {
1117
afterEach(() => {
1218
vi.restoreAllMocks()
@@ -25,7 +31,7 @@ describe('extractZipContent', () => {
2531
})
2632
vi.spyOn(URL, 'revokeObjectURL').mockImplementation(() => {})
2733

28-
const result = await extractZipContent(new File([zipData], 'root-images.zip'))
34+
const result = await extractZipContent(new File([toArrayBuffer(zipData)], 'root-images.zip'))
2935

3036
expect(result).not.toBeNull()
3137
expect(result?.content).toContain('AutoCollectStart')

0 commit comments

Comments
 (0)