test(e2e): use better mocking strategy for commits example

This commit is contained in:
Evan You
2019-12-11 10:15:52 -05:00
parent f48a4f71a7
commit c202bd6ac0
5 changed files with 37 additions and 27 deletions

View File

@@ -11,6 +11,12 @@ export function setupPuppeteer() {
beforeEach(async () => {
browser = await puppeteer.launch(puppeteerOptions)
page = await browser.newPage()
page.on('console', e => {
if (e.type() === 'error') {
console.error(`Error from Puppeteer-loaded page:`, e)
}
})
})
afterEach(async () => {