guys. This error will random appear when I running tests.
Chromium opened a tab, but soon automatic shut itself down quickly, then this error appeared.
I didn't find the answer on the google.
The error is happens randomly.
Error appear probability is higher of multiple tests running.
It won't all fail, often the last test will succeed.
FAIL __tests__/login/login.test.js
● Test suite failed to run
TypeError: Cannot read property 'browserContext' of undefined
at PuppeteerEnvironment.teardown (node_modules/jest-environment-puppeteer/lib/PuppeteerEnvironment.js:161:25)
FAIL __tests__/homepage/homepage.test.js
● Test suite failed to run
TypeError: Cannot read property 'browserContext' of undefined
at PuppeteerEnvironment.teardown (node_modules/jest-environment-puppeteer/lib/PuppeteerEnvironment.js:161:25)
FAIL __tests__/google.test.js
● Test suite failed to run
TypeError: Cannot read property 'browserContext' of undefined
at PuppeteerEnvironment.teardown (node_modules/jest-environment-puppeteer/lib/PuppeteerEnvironment.js:161:25)
jest-puppeteer.config.js
module.exports = {
launch: {
headless: !searchArgv('head'),
devtools: false,
// slowMo: 100,
defaultViewport: {
width: 1440,
height: 1080
},
},
browser: 'chromium',
browserContext: 'default'
};