Skip to content

Commit 775de9c

Browse files
committed
test: improve module version mismatch error check
Refs: #10606 PR-URL: #10636 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 8a12368 commit 775de9c

File tree

1 file changed

+6
-3
lines changed
  • test/addons/node-module-version

1 file changed

+6
-3
lines changed

test/addons/node-module-version/test.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ const common = require('../../common');
44
const assert = require('assert');
55

66
const re = new RegExp(
7-
'was compiled against a different Node.js version using\n' +
8-
'NODE_MODULE_VERSION 42. This version of Node.js requires\n' +
9-
`NODE_MODULE_VERSION ${process.versions.modules}.`);
7+
'^Error: The module \'.+\'\n' +
8+
'was compiled against a different Node\\.js version using\n' +
9+
'NODE_MODULE_VERSION 42\\. This version of Node\\.js requires\n' +
10+
`NODE_MODULE_VERSION ${process.versions.modules}. ` +
11+
'Please try re-compiling or re-installing\n' +
12+
'the module \\(for instance, using `npm rebuild` or `npm install`\\)\\.$');
1013

1114
assert.throws(() => require(`./build/${common.buildType}/binding`), re);

0 commit comments

Comments
 (0)