From 2fc538b60760ed90b840040ae941ce43c5d3d354 Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Sat, 16 Dec 2017 21:35:57 -0500 Subject: [PATCH] test: add test for missing custom plugin modules --- test/plugins/normalize.test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/plugins/normalize.test.js b/test/plugins/normalize.test.js index 6a5354be..69f3625a 100644 --- a/test/plugins/normalize.test.js +++ b/test/plugins/normalize.test.js @@ -117,3 +117,10 @@ test('Throws an error if the plugin return an object without the expected plugin 'The inexistantPlugin plugin must be a function, or an object with a function in the property inexistantPlugin.' ); }); + +test('Throws an error if the plugin is not found', t => { + const error = t.throws(() => normalize('inexistantPlugin', {}, 'non-existing-path', t.context.logger), Error); + + t.is(error.message, "Cannot find module 'non-existing-path'"); + t.is(error.code, 'MODULE_NOT_FOUND'); +});