(code)
| 56 | } |
| 57 | |
| 58 | function eval_console(code) { |
| 59 | let text = ""; |
| 60 | |
| 61 | const original_log = console.log; |
| 62 | console.log = function(...args) { |
| 63 | text += args.join(" ") + "\n"; |
| 64 | }; |
| 65 | |
| 66 | // run the code evaluation |
| 67 | eval(code); |
| 68 | |
| 69 | // give the code 1 second to complete |
| 70 | return new Promise((resolve, reject) => { |
| 71 | setTimeout(() => { |
| 72 | // fix console.log |
| 73 | console.log = original_log; |
| 74 | resolve(text); |
| 75 | }, 1000); |
| 76 | }); |
| 77 | } |
| 78 | |
| 79 | function compareHTML(a, b) { |
| 80 | // TODO - check CSS |