micropython/tests/ports/webassembly/py_proxy_has.mjs
Damien George c1513a078d tests/ports/webassembly: Add webassembly JS tests.
Signed-off-by: Damien George <damien@micropython.org>
2024-03-22 14:31:25 +11:00

12 lines
262 B
JavaScript

// Test `<attr> in <py-obj>` on the JavaScript side, which tests PyProxy.has.
const mp = await (await import(process.argv[2])).loadMicroPython();
mp.runPython(`
x = []
`);
const x = mp.globals.get("x");
console.log("no_exist" in x);
console.log("sort" in x);