We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 241fad4 commit 5582bfdCopy full SHA for 5582bfd
1 file changed
src/utils/__tests__/zipExtractor.test.ts
@@ -7,6 +7,12 @@ vi.mock('@tauri-apps/api/core', () => ({
7
8
import { extractZipContent } from '../zipExtractor'
9
10
+const toArrayBuffer = (bytes: Uint8Array): ArrayBuffer => {
11
+ const copy = new Uint8Array(bytes.byteLength)
12
+ copy.set(bytes)
13
+ return copy.buffer
14
+}
15
+
16
describe('extractZipContent', () => {
17
afterEach(() => {
18
vi.restoreAllMocks()
@@ -25,7 +31,7 @@ describe('extractZipContent', () => {
25
31
})
26
32
vi.spyOn(URL, 'revokeObjectURL').mockImplementation(() => {})
27
33
28
- const result = await extractZipContent(new File([zipData], 'root-images.zip'))
34
+ const result = await extractZipContent(new File([toArrayBuffer(zipData)], 'root-images.zip'))
29
35
30
36
expect(result).not.toBeNull()
37
expect(result?.content).toContain('AutoCollectStart')
0 commit comments