Browse Source

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 <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
v6
cjihrig 8 years ago
parent
commit
775de9cc96
  1. 9
      test/addons/node-module-version/test.js

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

@ -4,8 +4,11 @@ const common = require('../../common');
const assert = require('assert'); const assert = require('assert');
const re = new RegExp( const re = new RegExp(
'was compiled against a different Node.js version using\n' + '^Error: The module \'.+\'\n' +
'NODE_MODULE_VERSION 42. This version of Node.js requires\n' + 'was compiled against a different Node\\.js version using\n' +
`NODE_MODULE_VERSION ${process.versions.modules}.`); '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); assert.throws(() => require(`./build/${common.buildType}/binding`), re);

Loading…
Cancel
Save