This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Description
I have just starting playing with jest + playwright and was trying to run multiple browser configurations when I ran into this issue.
The error I am getting is
FAIL browser: firefox tests/basic.test.ts
● Test suite failed to run
TypeError: Cannot read property 'launch' of undefined
at getBrowserPerProcess (node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:24:41)
at PlaywrightEnvironment.setup (node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:62:41)
FAIL browser: firefox tests/basic.test.js
● Test suite failed to run
TypeError: Cannot read property 'launch' of undefined
at getBrowserPerProcess (node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:24:41)
at PlaywrightEnvironment.setup (node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:62:41)
Test Suites: 2 failed, 2 total
Tests: 0 total
Snapshots: 0 total
Time: 0.339 s
Ran all test suites.
jest.config.js
module.exports = {
preset: 'jest-playwright-preset'
};
jest-playwright.config.js
module.exports = {
browsers: [
// "chromium",
"firefox"
]
};
basic.test.js
describe('basic test', () => {
it('should load google.com', async () => {
await page.goto('https://google.com/');
expect(await page.title()).toBe("Google");
});
it('should also load google.com', async () => {
await page.goto('https://google.com/');
expect(await page.title()).toBe("Google");
})
});