Skip to content

Commit

Permalink
Revert "Include entire node global scope in node runner (pyodide#121)"
Browse files Browse the repository at this point in the history
This reverts commit 4b08451.
  • Loading branch information
hoodmane committed Nov 18, 2023
1 parent 06e3ef2 commit 069cfa5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pytest_pyodide/node_test_driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,22 @@ function _fetch(path) {

const context = {
loadPyodide,
...globalThis,
path,
process,
require,
setTimeout,
fetch: _fetch,
TextDecoder: util.TextDecoder,
TextEncoder: util.TextEncoder,
URL,
clearInterval,
clearTimeout,
setInterval,
setTimeout,
Headers
};
context.self = context;
vm.createContext(context);
vm.runInContext("globalThis.self = globalThis;", context);

// Get rid of all colors in output of console.log, they mess us up.
for (let key of Object.keys(util.inspect.styles)) {
Expand Down

0 comments on commit 069cfa5

Please sign in to comment.