From 6cbbef212d3d02ed556df42e8340ae87bab1aad0 Mon Sep 17 00:00:00 2001 From: Nick Playfair Date: Tue, 2 Feb 2021 17:19:43 +0000 Subject: [PATCH] Test number of assertions --- test/index.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/index.test.js b/test/index.test.js index c0186c5..de59a23 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -18,6 +18,7 @@ const imgConfig = { // getLayers test('Promise of an array of layers from a given folder', () => { + expect.assertions(1); return fileProc.getLayers(testLayers).then((data) => { expect(data).toEqual( expect.arrayContaining([ @@ -31,12 +32,14 @@ test('Promise of an array of layers from a given folder', () => { }); test('Non-existent folder should reject promise with error', () => { + expect.assertions(1); return expect(fileProc.getLayers('./invalid_folder')).rejects.toThrow( 'Layers folder does not exist.' ); }); test('Folder with incorrect number of layers should reject promise with error', () => { + expect.assertions(1); return expect(fileProc.getLayers(emptyFolder)).rejects.toThrow( 'Layer not found.' ); @@ -83,6 +86,7 @@ test('Invalid archive file should throw an error', () => { }); test('Gerber archive should resolve promise and return a filename of an image', () => { + expect.assertions(1); return expect( fileProc.gerberToImage(testGerber, imgConfig, tmpDir, imgDir) ).resolves.toEqual(expect.stringContaining('Arduino-Pro-Mini.png'));