test: fix parsing of MODULE_NOT_FOUND errors message in unit tests

This commit is contained in:
Pierre Vanduynslager 2019-06-05 16:05:27 -04:00
parent 3610422959
commit d4f28abd47
2 changed files with 2 additions and 2 deletions

View File

@ -513,6 +513,6 @@ test('Throw an Error if one of the shareable config cannot be found', async t =>
const error = await t.throwsAsync(t.context.getConfig({cwd}), Error); const error = await t.throwsAsync(t.context.getConfig({cwd}), Error);
t.is(error.message, "Cannot find module 'non-existing-path'"); t.regex(error.message, /Cannot find module 'non-existing-path'/);
t.is(error.code, 'MODULE_NOT_FOUND'); t.is(error.code, 'MODULE_NOT_FOUND');
}); });

View File

@ -273,6 +273,6 @@ test('Throws an error if the plugin is not found', t => {
Error Error
); );
t.is(error.message, "Cannot find module 'non-existing-path'"); t.regex(error.message, /Cannot find module 'non-existing-path'/);
t.is(error.code, 'MODULE_NOT_FOUND'); t.is(error.code, 'MODULE_NOT_FOUND');
}); });