Skip to content

Commit

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

const context = {
loadPyodide,
path,
process,
require,
setTimeout,
fetch: _fetch,
TextDecoder: util.TextDecoder,
TextEncoder: util.TextEncoder,
URL,
clearInterval,
clearTimeout,
setInterval,
setTimeout,
Headers
...globalThis,
};
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 4b08451

Please sign in to comment.