diff --git a/test/index.test.js b/test/index.test.js index 9b428a7..b8934b0 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -29,3 +29,16 @@ test('Non-existent folder should reject promise with error', () => { test('Folder with incorrect number of layers should reject promise with error', () => { return expect(fileProc.getLayers2(emptyFolder)).rejects.toThrow('Layer not found.'); }); + +// extractArchive +test('Non-existent archive should throw an error', () => { + return expect(fileProc.extractArchive('invalid.zip', tmpDir)).rejects.toThrow(Error); +}); + +test('Temp dir not existing should throw an error', () => { + return expect(fileProc.extractArchive(testGerber, './invalid_dir')).rejects.toThrow(Error); +}); + +test('Should extract archive and resolve with the number of files extracted', () => { + return expect(fileProc.extractArchive(testGerber, tmpDir)).resolves.toBe(12); +}); \ No newline at end of file