Skip to content

Commit

Permalink
handle errors thrown from test pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotz committed Feb 10, 2024
1 parent ac2da70 commit ef2bf85
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const onConsole = (strategy, pageN) => async e => {
console.log(`${strategy} #${pageN}:`, ...args)
}

const onError = (strategy, pageN) => err =>
console.log(`* error! * ${strategy} #${pageN}: ${err.message}`)

export default strategy =>
test(`Trystero: ${strategy}`, async ({page, context, browserName}) => {
const trackerRedundancy = 3
Expand All @@ -24,6 +27,8 @@ export default strategy =>

page.on('console', onConsole(strategy, 1))
page2.on('console', onConsole(strategy, 2))
page.on('pageerror', onError(strategy, 1))
page2.on('pageerror', onError(strategy, 2))

await page.goto(testUrl)
await page2.goto(testUrl)
Expand Down

0 comments on commit ef2bf85

Please sign in to comment.