mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 17:01:08 +00:00

PR-URL: https://github.com/nodejs/node/pull/15853 Reviewed-By: Ryan Graham <r.m.graham@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
15 lines
610 B
JavaScript
15 lines
610 B
JavaScript
// Flags: --expose_internals
|
|
'use strict';
|
|
require('../common');
|
|
const fixtures = require('../common/fixtures');
|
|
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(fixtures.path('module-require-depth', 'one'));
|
|
const two = require(fixtures.path('module-require-depth', 'two'));
|
|
assert.deepStrictEqual(one, { requireDepth: 1 });
|
|
assert.deepStrictEqual(two, { requireDepth: 2 });
|
|
assert.strictEqual(internalModule.requireDepth, 0);
|