diff --git a/test/index.test.js b/test/index.test.js index 138b0dd..d67a320 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -6,6 +6,7 @@ const { ImageGenerator } = require('../index.js'); require('../index.js'); const testGerber = path.join(__dirname, 'Arduino-Pro-Mini.zip'); +const incompleteGerber = path.join(__dirname, 'incomplete.zip'); const testLayers = path.join(__dirname, 'layers'); const emptyFolder = path.join(__dirname, 'layers', 'Empty'); const folderConfig = { @@ -105,6 +106,14 @@ test('Invalid archive file should throw an error', () => { ); }); +test('Archive with incomplete set of layers should throw an error', () => { + expect(() => + fileProc + .gerberToImage(incompleteGerber) + .toThrow(Error) + ); +}); + test('Gerber archive should resolve promise and return a filename of an image', () => { expect.assertions(1); return expect(