1 import { chromium, firefox, webkit } from 'playwright';
2 import { strict as assert } from 'assert';
4 for (const browserType of [chromium, firefox]) { // We'd like to test webkit, but playwright doesn't support it on Debian (?!)
6 if (browserType == chromium)
7 browser = await browserType.launch(["--js-flags=\"--expose-gc\""]);
9 browser = await browserType.launch();
10 const context = await browser.newContext();
11 const page = await context.newPage();
12 page.on('console', async msg => {
14 for (const arg of msg.args())
15 values.push(await arg.jsonValue());
16 console.log(...values);
18 await page.goto('http://localhost:8000/test/index.html');
20 // On chromium we expose the GC and can run it manually, otherwise we really can't leak-check
21 if (browserType == chromium) {
22 ret = await page.evaluate(() => { return test_runner('../liblightningjs.wasm', true); });
24 ret = await page.evaluate(() => { return test_runner('../liblightningjs.wasm', false); });
28 await browser.close();