Skip to content

Commit 4b08451

Browse files
authored
Include entire node global scope in node runner (pyodide#121)
1 parent 5da94f5 commit 4b08451

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

pytest_pyodide/node_test_driver.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,10 @@ function _fetch(path) {
1717

1818
const context = {
1919
loadPyodide,
20-
path,
21-
process,
22-
require,
23-
setTimeout,
24-
fetch: _fetch,
25-
TextDecoder: util.TextDecoder,
26-
TextEncoder: util.TextEncoder,
27-
URL,
28-
clearInterval,
29-
clearTimeout,
30-
setInterval,
31-
setTimeout,
32-
Headers
20+
...globalThis,
3321
};
22+
context.self = context;
3423
vm.createContext(context);
35-
vm.runInContext("globalThis.self = globalThis;", context);
3624

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

0 commit comments

Comments
 (0)