From d4f28abd470879b8ba56ca3427ec91b345a1fc40 Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Wed, 5 Jun 2019 16:05:27 -0400 Subject: [PATCH] test: fix parsing of `MODULE_NOT_FOUND` errors message in unit tests --- test/get-config.test.js | 2 +- test/plugins/normalize.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/get-config.test.js b/test/get-config.test.js index c243c91b..80fd72d0 100644 --- a/test/get-config.test.js +++ b/test/get-config.test.js @@ -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); - 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'); }); diff --git a/test/plugins/normalize.test.js b/test/plugins/normalize.test.js index 9c5f2125..dd93467e 100644 --- a/test/plugins/normalize.test.js +++ b/test/plugins/normalize.test.js @@ -273,6 +273,6 @@ test('Throws an error if the plugin is not found', t => { 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'); });