0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/addons/node-module-version/test.js
Brian White 61ebfa8d1f tools: add unescaped regexp dot rule to linter
PR-URL: https://github.com/nodejs/node/pull/11834
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-03-29 10:53:28 +02:00

15 lines
540 B
JavaScript

'use strict';
const common = require('../../common');
const assert = require('assert');
const re = new RegExp(
'^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);