mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
ci: fix mocha utils (#10496)
This commit is contained in:
parent
d16ca474d3
commit
5a3abb2f5e
@ -39,17 +39,6 @@ import sinon from 'sinon';
|
||||
|
||||
import {extendExpectWithToBeGolden} from './utils.js';
|
||||
|
||||
let processVariables!: {
|
||||
product: string;
|
||||
alternativeInstall: string | boolean;
|
||||
headless: 'true' | 'false' | 'new';
|
||||
isHeadless: boolean;
|
||||
isFirefox: boolean;
|
||||
isChrome: boolean;
|
||||
protocol: 'cdp' | 'webDriverBiDi';
|
||||
defaultBrowserOptions: PuppeteerLaunchOptions;
|
||||
};
|
||||
async function setUpProcessVariables() {
|
||||
const product =
|
||||
process.env['PRODUCT'] || process.env['PUPPETEER_PRODUCT'] || 'chrome';
|
||||
|
||||
@ -68,9 +57,7 @@ async function setUpProcessVariables() {
|
||||
|
||||
let extraLaunchOptions = {};
|
||||
try {
|
||||
extraLaunchOptions = JSON.parse(
|
||||
process.env['EXTRA_LAUNCH_OPTIONS'] || '{}'
|
||||
);
|
||||
extraLaunchOptions = JSON.parse(process.env['EXTRA_LAUNCH_OPTIONS'] || '{}');
|
||||
} catch (error) {
|
||||
if (isErrorLike(error)) {
|
||||
console.warn(
|
||||
@ -105,7 +92,16 @@ async function setUpProcessVariables() {
|
||||
}
|
||||
}
|
||||
|
||||
processVariables = {
|
||||
const processVariables: {
|
||||
product: string;
|
||||
alternativeInstall: string | boolean;
|
||||
headless: 'true' | 'false' | 'new';
|
||||
isHeadless: boolean;
|
||||
isFirefox: boolean;
|
||||
isChrome: boolean;
|
||||
protocol: 'cdp' | 'webDriverBiDi';
|
||||
defaultBrowserOptions: PuppeteerLaunchOptions;
|
||||
} = {
|
||||
product,
|
||||
alternativeInstall,
|
||||
headless,
|
||||
@ -115,10 +111,6 @@ async function setUpProcessVariables() {
|
||||
protocol,
|
||||
defaultBrowserOptions,
|
||||
};
|
||||
}
|
||||
(async (): Promise<void> => {
|
||||
await setUpProcessVariables();
|
||||
})();
|
||||
|
||||
const setupServer = async () => {
|
||||
const assetsPath = path.join(__dirname, '../assets');
|
||||
|
Loading…
Reference in New Issue
Block a user