0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-require-json.js
Sarah Meyer f51c02f8a0 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>
2016-12-04 19:07:49 -08:00

13 lines
381 B
JavaScript

'use strict';
const common = require('../common');
const path = require('path');
const assert = require('assert');
try {
require(path.join(common.fixturesDir, 'invalid.json'));
} catch (err) {
const re = /test[/\\]fixtures[/\\]invalid.json: Unexpected string/;
const i = err.message.match(re);
assert.notStrictEqual(null, i, 'require() json error should include path');
}