From 01a0b2d08a2c93eba3de8c60e9ba1cabcca55b3e Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Tue, 25 Jun 2019 11:17:27 -0400 Subject: [PATCH] test: use regexp to check missing module message --- 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 9ea58ec9..28efa0b6 100644 --- a/test/get-config.test.js +++ b/test/get-config.test.js @@ -482,6 +482,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 64dfec8f..97ebbcdd 100644 --- a/test/plugins/normalize.test.js +++ b/test/plugins/normalize.test.js @@ -255,6 +255,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'); });