Test extractArchive
This commit is contained in:
parent
e7e2f02581
commit
702245e0bd
@ -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);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user