()
| 8 | */ |
| 9 | window.runExample = async function (emulatorUrl) { |
| 10 | const foo = async () => { |
| 11 | const { Nodebox } = window; |
| 12 | |
| 13 | const emulator = new Nodebox({ |
| 14 | runtimeUrl: emulatorUrl, |
| 15 | iframe: document.getElementById('frame'), |
| 16 | }); |
| 17 | |
| 18 | await emulator.connect(); |
| 19 | await emulator.fs.init({ |
| 20 | 'index.mjs': `console.group("a", "b"); |
| 21 | console.log("test"); |
| 22 | console.group("bla"); |
| 23 | console.warn("tada"); |
| 24 | console.groupEnd(); |
| 25 | console.error("woops"); |
| 26 | console.groupEnd(); |
| 27 | console.table({a: "b", nested: {aa: "bbb"}}); |
| 28 | console.table(["aaa", "bbb"]); |
| 29 | console.table(["aaa", "bbb"], []); |
| 30 | console.table({a: "b", nested: {aa: "bbb", bb: "aaa"}}, ["aa"]);`, |
| 31 | }); |
| 32 | |
| 33 | const shellProcess = emulator.shell.create(); |
| 34 | shellProcess.stdout.on('data', (data) => { |
| 35 | console.log(data); |
| 36 | }); |
| 37 | shellProcess.stderr.on('data', (data) => { |
| 38 | console.error(data); |
| 39 | }); |
| 40 | await shellProcess.runCommand('node', ['index.mjs']); |
| 41 | }; |
| 42 | |
| 43 | foo(); |
| 44 | }; |
no test coverage detected