test: refactor test-internal-modules

* var -> const
* add RegExp to assert.throws() to check error message

PR-URL: https://github.com/nodejs/node/pull/10016
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Christy Leung authored and Rich Trott committed 2016-12-23 22:48:48 -08:00
1 parent 1fddf5b6d6
commit c00f647963
1 file changed
+4 -4
+4 -4
View File
@@ -1,11 +1,11 @@
'use strict';
var common = require('../common');
var path = require('path');
var assert = require('assert');
const common = require('../common');
const path = require('path');
const assert = require('assert');
assert.throws(function() {
require('internal/freelist');
});
}, /^Error: Cannot find module 'internal\/freelist'$/);
assert.strictEqual(
require(path.join(common.fixturesDir, 'internal-modules')),