From f75282566c939947755245d214513645854f281e Mon Sep 17 00:00:00 2001 From: Nick Playfair Date: Fri, 5 Feb 2021 14:49:32 +0000 Subject: [PATCH] test for incomplete gerber archive --- test/index.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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(