Closed
Description
I just tried this piece of code:
const playwright = require('playwright');
try {
await page.waitForSelector('.foo');
} catch (e) {
if (e instanceof playwright.errors.TimeoutError) {
// Do something if this is a timeout.
}
} else {
console.log(err);
}
}
I am running this with Jest however, so unsure if this affects it, but for me it ends up in the else branch. I assume that is not supposed to happen.
This does work:
if (err.name === 'TimeoutError')
Metadata
Metadata
Assignees
Labels
No labels