From 775de9cc96d6fe01c049cd4a3d5ed2df922b88b6 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Wed, 4 Jan 2017 10:29:40 -0500 Subject: [PATCH] test: improve module version mismatch error check Refs: https://github.com/nodejs/node/pull/10606 PR-URL: https://github.com/nodejs/node/pull/10636 Reviewed-By: James M Snell Reviewed-By: Rich Trott --- test/addons/node-module-version/test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/addons/node-module-version/test.js b/test/addons/node-module-version/test.js index 75d811de9cfe41..94db088395fefa 100644 --- a/test/addons/node-module-version/test.js +++ b/test/addons/node-module-version/test.js @@ -4,8 +4,11 @@ const common = require('../../common'); const assert = require('assert'); const re = new RegExp( - 'was compiled against a different Node.js version using\n' + - 'NODE_MODULE_VERSION 42. This version of Node.js requires\n' + - `NODE_MODULE_VERSION ${process.versions.modules}.`); + '^Error: The module \'.+\'\n' + + 'was compiled against a different Node\\.js version using\n' + + 'NODE_MODULE_VERSION 42\\. This version of Node\\.js requires\n' + + `NODE_MODULE_VERSION ${process.versions.modules}. ` + + 'Please try re-compiling or re-installing\n' + + 'the module \\(for instance, using `npm rebuild` or `npm install`\\)\\.$'); assert.throws(() => require(`./build/${common.buildType}/binding`), re);