fix(fetch): skip tests on non-default modes, add node-fetch to deps list (#8425)

This commit is contained in:
Dmitry Gozman 2021-08-24 19:41:29 -07:00 committed by GitHub
parent a6740c852a
commit 33852635b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -72,6 +72,7 @@ const DEPENDENCIES = [
'https-proxy-agent',
'jpeg-js',
'mime',
'node-fetch',
'pngjs',
'progress',
'proper-lockfile',
@ -140,8 +141,11 @@ if (!args.some(arg => arg === '--no-cleanup')) {
const pwInternalJSON = require(path.join(ROOT_PATH, 'package.json'));
const depNames = packageName === 'playwright-test' ? Object.keys(pwInternalJSON.dependencies) : DEPENDENCIES;
const dependencies = {};
for (const dep of depNames)
dependencies[dep] = pwInternalJSON.dependencies[dep];
for (const dep of depNames) {
if (!pwInternalJSON.dependencies[dep])
throw new Error(`Dependecy ${dep} was removed from package.json, but not build_package.js`);
dependencies[dep] = pwInternalJSON.dependencies[dep];
}
await writeToPackage('package.json', JSON.stringify({
name: package.name || packageName,
version: pwInternalJSON.version,

View File

@ -17,6 +17,8 @@
import http from 'http';
import { contextTest as it, expect } from './config/browserTest';
it.skip(({ mode }) => mode !== 'default');
let prevAgent: http.Agent;
it.beforeAll(() => {
prevAgent = http.globalAgent;