(body)
| 7 | const source = fs.readFileSync(path.resolve(__dirname, '../src/table.js'), 'utf8'); |
| 8 | |
| 9 | function setup(body) { |
| 10 | const dom = new JSDOM(`<!doctype html><html><body>${body}</body></html>`, { |
| 11 | pretendToBeVisual: true, |
| 12 | runScripts: 'dangerously', |
| 13 | url: 'https://example.test/' |
| 14 | }); |
| 15 | |
| 16 | dom.window.console.warn = () => {}; |
| 17 | dom.window.eval(source); |
| 18 | return dom; |
| 19 | } |
| 20 | |
| 21 | function click(window, element) { |
| 22 | element.dispatchEvent(new window.MouseEvent('click', { bubbles: true })); |