test: add test for missing custom plugin modules

This commit is contained in:
Pierre Vanduynslager 2017-12-16 21:35:57 -05:00
parent f707b1a90a
commit 2fc538b607

View File

@ -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.' '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');
});