diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index efde1eb796..b0e4be89b1 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -1261,6 +1261,15 @@ internals.requireImpl = { nativeModuleExports, }; +/** + * @param {string} path + * @returns {SourceMap | undefined} + */ +export function findSourceMap(_path) { + // TODO(@marvinhagemeister): Stub implementation for now to unblock ava + return undefined; +} + export { builtinModules, createRequire, isBuiltin, Module }; export const _cache = Module._cache; export const _extensions = Module._extensions; diff --git a/tests/unit_node/module_test.ts b/tests/unit_node/module_test.ts index cfb9a4ebfe..c17aabc72e 100644 --- a/tests/unit_node/module_test.ts +++ b/tests/unit_node/module_test.ts @@ -1,6 +1,12 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { builtinModules, createRequire, isBuiltin, Module } from "node:module"; +import { + builtinModules, + createRequire, + findSourceMap, + isBuiltin, + Module, +} from "node:module"; import { assert, assertEquals } from "@std/assert/mod.ts"; import process from "node:process"; import * as path from "node:path"; @@ -88,3 +94,8 @@ Deno.test("[node/module isBuiltin] recognizes node builtins", () => { Deno.test("[node/module builtinModules] has 'module' in builtins", () => { assert(builtinModules.includes("module")); }); + +// https://github.com/denoland/deno/issues/18666 +Deno.test("[node/module findSourceMap] is a function", () => { + assertEquals(findSourceMap("foo"), undefined); +});