test for incomplete gerber archive

This commit is contained in:
Nick Playfair 2021-02-05 14:49:32 +00:00
parent f927239ed3
commit f75282566c

View File

@ -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(