node/test/fixtures/module-hooks/require-resolve-caller.js
Joyee Cheung dd400b9f12
module: run require.resolve through module.registerHooks()
Previously, require.resolve() called Module._resolveFilename() directly,
bypassing any resolve hooks registered via module.registerHooks(). This
patch fixes that.

PR-URL: https://github.com/nodejs/node/pull/62028
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2026-03-02 18:28:25 +00:00

4 lines
186 B
JavaScript

// Fixture CJS file that calls require.resolve and exports the result.
'use strict';
const resolved = require.resolve('test-require-resolve-hook-target');
module.exports = { resolved };