mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-07 11:46:42 +03:00
fix(fetch): skip tests on non-default modes, add node-fetch to deps list (#8425)
This commit is contained in:
parent
a6740c852a
commit
33852635b7
@ -72,6 +72,7 @@ const DEPENDENCIES = [
|
|||||||
'https-proxy-agent',
|
'https-proxy-agent',
|
||||||
'jpeg-js',
|
'jpeg-js',
|
||||||
'mime',
|
'mime',
|
||||||
|
'node-fetch',
|
||||||
'pngjs',
|
'pngjs',
|
||||||
'progress',
|
'progress',
|
||||||
'proper-lockfile',
|
'proper-lockfile',
|
||||||
@ -140,8 +141,11 @@ if (!args.some(arg => arg === '--no-cleanup')) {
|
|||||||
const pwInternalJSON = require(path.join(ROOT_PATH, 'package.json'));
|
const pwInternalJSON = require(path.join(ROOT_PATH, 'package.json'));
|
||||||
const depNames = packageName === 'playwright-test' ? Object.keys(pwInternalJSON.dependencies) : DEPENDENCIES;
|
const depNames = packageName === 'playwright-test' ? Object.keys(pwInternalJSON.dependencies) : DEPENDENCIES;
|
||||||
const dependencies = {};
|
const dependencies = {};
|
||||||
for (const dep of depNames)
|
for (const dep of depNames) {
|
||||||
dependencies[dep] = pwInternalJSON.dependencies[dep];
|
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({
|
await writeToPackage('package.json', JSON.stringify({
|
||||||
name: package.name || packageName,
|
name: package.name || packageName,
|
||||||
version: pwInternalJSON.version,
|
version: pwInternalJSON.version,
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
import http from 'http';
|
import http from 'http';
|
||||||
import { contextTest as it, expect } from './config/browserTest';
|
import { contextTest as it, expect } from './config/browserTest';
|
||||||
|
|
||||||
|
it.skip(({ mode }) => mode !== 'default');
|
||||||
|
|
||||||
let prevAgent: http.Agent;
|
let prevAgent: http.Agent;
|
||||||
it.beforeAll(() => {
|
it.beforeAll(() => {
|
||||||
prevAgent = http.globalAgent;
|
prevAgent = http.globalAgent;
|
||||||
|
Loading…
Reference in New Issue
Block a user