mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
PR-URL: https://github.com/nodejs/node/pull/12735 Refs: https://github.com/nodejs/node/pull/12455 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
14 lines
585 B
JavaScript
14 lines
585 B
JavaScript
// Flags: --expose_internals
|
|
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const internalModule = require('internal/module');
|
|
|
|
// Module one loads two too so the expected depth for two is, well, two.
|
|
assert.strictEqual(internalModule.requireDepth, 0);
|
|
const one = require(`${common.fixturesDir}/module-require-depth/one`);
|
|
const two = require(`${common.fixturesDir}/module-require-depth/two`);
|
|
assert.deepStrictEqual(one, { requireDepth: 1 });
|
|
assert.deepStrictEqual(two, { requireDepth: 2 });
|
|
assert.strictEqual(internalModule.requireDepth, 0);
|