Skip to content

Commit

Permalink
fix(mocker): include more modules to prefix-only module list (#7524)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea authored Feb 19, 2025
1 parent f71004f commit a12ec00
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/mocker/src/node/redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ const builtins = new Set([
'wasi',
])

const prefixedBuiltins = new Set(['node:test', 'node:sqlite'])
// https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
const prefixedBuiltins = new Set([
'node:sea',
'node:sqlite',
'node:test',
'node:test/reporters',
])
const NODE_BUILTIN_NAMESPACE = 'node:'
function isNodeBuiltin(id: string): boolean {
if (prefixedBuiltins.has(id)) {
Expand Down

0 comments on commit a12ec00

Please sign in to comment.