Browse Source

test: use const instead of var in test-require-json.js

PR-URL: https://github.com/nodejs/node/pull/9904
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6.x
Sarah Meyer 8 years ago
committed by Anna Henningsen
parent
commit
e9d4665b29
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 10
      test/parallel/test-require-json.js

10
test/parallel/test-require-json.js

@ -1,12 +1,12 @@
'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');
try {
require(path.join(common.fixturesDir, 'invalid.json'));
} catch (err) {
var re = /test[/\\]fixtures[/\\]invalid.json: Unexpected string/;
var i = err.message.match(re);
const re = /test[/\\]fixtures[/\\]invalid.json: Unexpected string/;
const i = err.message.match(re);
assert.notStrictEqual(null, i, 'require() json error should include path');
}

Loading…
Cancel
Save