Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/unit/miner-extension-live-fetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ function loadBackgroundWithFakeChrome({
__LOOPOVER_MINER_EXTENSION_TEST__: true,
chrome,
fetch: fetchImpl,
// node:vm's createContext() is a fresh, isolated realm with none of the outer process's globals --
// background.js's live-fetch path bounds its fetch with AbortSignal.timeout(...) (#4c0b19f4) and
// measures the real serialized byte size via TextEncoder for the quota guard (#7062), so the sandbox
// needs both real globals injected or those calls throw "<Global> is not defined" on any payload that
// reaches the success path.
AbortSignal,
TextEncoder,
};
context.globalThis = context;
const vmContext = createContext(context);
Expand Down