mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
The original commit was landed without running CITGM. Unfortunately this change breaks the module `d` which has over 500k downloads a day. It is worth mentioning that the compatibility hack can be removed without breaking anything. We should definitely revisit for the next Semver-Major but shipping this today will cause non trivial ecosystem breakages. Refs: https://github.com/nodejs/node/pull/3384 PR-URL: https://github.com/nodejs/node/pull/16634 Refs: https://github.com/nodejs/node/pull/3384 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
19 lines
596 B
JavaScript
19 lines
596 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);
|
|
assert.strictEqual(a, b, 'require(".") should resolve like require("./")');
|
|
|
|
process.env.NODE_PATH = fixtures.path('module-require', 'relative');
|
|
m._initPaths();
|
|
|
|
const c = require('.');
|
|
|
|
assert.strictEqual(c.value, 42, 'require(".") should honor NODE_PATH');
|