Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: allow empty string in regex patterns (#31804)
Pavel Feldmancf1a313a0c5f
diff --git a/packages/playwright/src/isomorphic/teleReceiver.ts b/packages/playwright/src/isomorphic/teleReceiver.tsindex da377b099f..6391f8a64c 100644--- a/packages/playwright/src/isomorphic/teleReceiver.ts+++ b/packages/playwright/src/isomorphic/teleReceiver.ts@@ -19,8 +19,6 @@ import type { Metadata } from '../../types/test';import type * as reporterTypes from '../../types/testReporter';import type { ReporterV2 } from '../reporters/reporterV2';-// -- Reuse boundary -- Everything below this line is reused in the vscode extension.-export type StringIntern = (s: string) => string;export type JsonLocation = reporterTypes.Location;export type JsonError = string;@@ -613,7 +611,7 @@ export function serializeRegexPatterns(patterns: string | RegExp | (string | Regexport function parseRegexPatterns(patterns: JsonPattern[]): (string | RegExp)[] {return patterns.map(p => {- if (p.s)+ if (p.s !== undefined)return p.s;return new RegExp(p.r!.source, p.r!.flags);});diff --git a/packages/playwright/src/isomorphic/testServerConnection.ts b/packages/playwright/src/isomorphic/testServerConnection.tsindex aeda824429..156af26e8c 100644--- a/packages/playwright/src/isomorphic/testServerConnection.ts+++ b/packages/playwright/src/isomorphic/testServerConnection.ts@@ -38,6 +38,7 @@ export class TestServerConnection implements TestServerInterface, TestServerInteprivate _ws: WebSocket;private _callbacks = new Map<number, { resolve: (arg: any) => void, reject: (arg: Error) => void }>();private _connectedPromise: Promise<void>;+ private _isClosed = false;constructor(wsURL: string) {this.onClose = this._onCloseEmitter.event;@@ -70,11 +71,16 @@ export class TestServerConnection implements TestServerInterface, TestServerIntethis._ws.addEventListener('error', r);});this._ws.addEventListener('close', () => {+ this._isClosed = true;this._onCloseEmitter.fire();clearInterval(pingInterval);});}+ isClosed(): boolean {+ return this._isClosed;+ }+private async _sendMessage(method: string, params?: any): Promise<any> {const logForTest = (globalThis as any).__logForTest;logForTest?.({ method, params });diff --git a/packages/playwright/src/reporters/teleEmitter.ts b/packages/playwright/src/reporters/teleEmitter.tsindex df77370dd2..670a8c16c8 100644--- a/packages/playwright/src/reporters/teleEmitter.ts+++ b/packages/playwright/src/reporters/teleEmitter.ts@@ -21,8 +21,6 @@ import type * as teleReceiver from '../isomorphic/teleReceiver';import { serializeRegexPatterns } from '../isomorphic/teleReceiver';import type { ReporterV2 } from './reporterV2';-// -- Reuse boundary -- Everything below this line is reused in the vscode extension.-export type TeleReporterEmitterOptions = {omitOutput?: boolean;omitBuffers?: boolean;