Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 80f8110

Browse files
committed
debugging
1 parent 0c235c3 commit 80f8110

File tree

1 file changed

+10
-0
lines changed
  • examples/browser-service-worker/tests

1 file changed

+10
-0
lines changed

examples/browser-service-worker/tests/test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,21 @@ play.describe('browser service worker:', () => {
1414
const linkDOM = "a"
1515
const textDOM = "body"
1616
const debugDOM = "#debug"
17+
const errorLogs = []
1718

1819
play.beforeEach(async ({servers, page}) => {
1920
await page.goto(`http://localhost:${servers[0].port}/`);
2021
})
2122

2223
play('should properly load the content of an IPFS hash', async ({ servers, page }) => {
24+
page.on("console", (message) => {
25+
if (message.type() === "error") {
26+
errorLogs.push(message.text())
27+
}
28+
})
29+
page.on("pageerror", (err) => {
30+
console.log(err.message)
31+
})
2332
await page.waitForSelector(textDOM)
2433
await page.waitForSelector(linkDOM)
2534

@@ -49,6 +58,7 @@ play.describe('browser service worker:', () => {
4958
});
5059

5160
play.afterAll(async ({servers}) => {
61+
console.log("errorLogs", errorLogs)
5262
// now stop all servers
5363
for (const server of servers) {
5464
await server.stop()

0 commit comments

Comments
 (0)