From 0331a47dea802887b3fef5d75b8bfe949f788057 Mon Sep 17 00:00:00 2001 From: Nick Playfair Date: Sat, 6 Feb 2021 17:06:55 +0000 Subject: [PATCH] Test constructor --- test/index.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/index.test.js b/test/index.test.js index d67a320..f8df36b 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -35,6 +35,19 @@ const fileProcNoImage = new ImageGenerator(noImageConfig, imgConfig); * Tests ***************/ +// Test constructor +test('Create ImageGenerator object with the passed in config values', () => { + const imgGen = new ImageGenerator(folderConfig, imgConfig); + expect(imgGen).toBeInstanceOf(ImageGenerator); + // Image processing configuration + expect(imgGen.imgConfig.resizeWidth).toBe(600); + expect(imgGen.imgConfig.density).toBe(1000); + expect(imgGen.imgConfig.compLevel).toBe(1); + // Folders + expect(imgGen.tmpDir).toBe(path.join(__dirname, 'tmp')); + expect(imgGen.imgDir).toBe(path.join(__dirname, 'tmp')); +}) + // getLayers test('Promise of an array of layers from a given folder', () => { expect.assertions(1);