Skip to content

Commit 3a235df

Browse files
author
Ben Dehghan
committed
fixes the bug for this:
Cannot read properties of undefined (reading '_launcher') see https://stackoverflow.com/questions/69494700/puppeteer-launcher-error-results-with-undefined for info branches visual-regression-bug-fix
1 parent 9a07fe0 commit 3a235df

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

projects/cli/src/check-snapshots.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { writeFileSync, unlinkSync, existsSync, readdirSync } from 'fs';
2-
import { Browser, launch } from 'puppeteer';
2+
import * as puppeteer from 'puppeteer';
33
import { resolve as resolvePath, isAbsolute } from 'path';
44
import { runCLI } from '@jest/core';
55
import { Config as JestConfig } from '@jest/types';
@@ -20,7 +20,7 @@ export interface ViewportOptions {
2020
const CHROME_ARGS = ['--disable-gpu', '--no-sandbox'];
2121
const TEST_PATH_BASE = resolvePath('./test-image-snapshots.js');
2222

23-
let browser: Browser;
23+
let browser: puppeteer.Browser;
2424

2525
// Ensure Chromium instances are destroyed on error
2626
process.on('unhandledRejection', async () => {
@@ -57,7 +57,7 @@ async function main(config: Config, hostUrl: string, testPath: string, viewportC
5757
writeSandboxesToTestFile(config, hostUrl, testPath, viewportConfig);
5858

5959
// launch puppeteer headless browser to render scenarios
60-
browser = await launch({
60+
browser = await puppeteer.launch({
6161
headless: true,
6262
handleSIGINT: false,
6363
args: CHROME_ARGS,

0 commit comments

Comments
 (0)