node/test/parallel/test-require-dot.js
Lucas Liepert b23f8ee677
test: removed message from strictEqual
By removing the message from strictEqual, it will now print out the
actual values of a and b, which will be more helpful in debugging. The
old message has been added as a comment above the test.

PR-URL: https://github.com/nodejs/node/pull/20983
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-06-01 11:19:48 +02:00

23 lines
634 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const m = require('module');
const fixtures = require('../common/fixtures');
const a = require(fixtures.path('module-require', 'relative', 'dot.js'));
const b = require(fixtures.path('module-require', 'relative', 'dot-slash.js'));
assert.strictEqual(a.value, 42);
// require(".") should resolve like require("./")
assert.strictEqual(a, b);
process.env.NODE_PATH = fixtures.path('module-require', 'relative');
m._initPaths();
const c = require('.');
assert.strictEqual(
c.value,
42,
`require(".") should honor NODE_PATH; expected 42, found ${c.value}`
);