Fix #2220 - Avoid DOM notifications on errors (#2226)

* Fix #2220 - Avoid DOM notifications on errors
This commit is contained in:
Andrea Giammarchi
2024-10-17 16:18:05 +02:00
committed by GitHub
parent 5d751493f6
commit 6b1330d28a
12 changed files with 118 additions and 38 deletions

View File

@@ -138,3 +138,17 @@ test('Pyodide lockFileURL vs CDN', async ({ page }) => {
const body = await page.evaluate(() => document.body.textContent);
await expect(body).toBe('OK');
});
test('MicroPython buffered error', async ({ page }) => {
await page.goto('http://localhost:8080/tests/javascript/mpy-error.html');
await page.waitForSelector('html.ok');
const body = await page.evaluate(() => document.body.textContent.trim());
await expect(body).toBe('This is an error');
});
test('MicroPython buffered NO error', async ({ page }) => {
await page.goto('http://localhost:8080/tests/javascript/mpy-no-error.html');
await page.waitForSelector('html.ok');
const body = await page.evaluate(() => document.body.textContent.trim());
await expect(body).toBe('');
});