fix test-server-connection test

This commit is contained in:
Simon Knott 2024-08-23 14:29:36 +02:00
parent 577602d95b
commit 17638d08a2
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
2 changed files with 3 additions and 3 deletions

View file

@ -32,7 +32,7 @@ export interface TestServerTransport {
export class WebSocketTestServerTransport implements TestServerTransport {
private _ws: WebSocket;
constructor(url: URL) {
constructor(url: string | URL) {
this._ws = new WebSocket(url);
}

View file

@ -15,13 +15,13 @@
*/
import { test as baseTest, expect } from './ui-mode-fixtures';
import { TestServerConnection } from '../../packages/playwright/lib/isomorphic/testServerConnection';
import { TestServerConnection, WebSocketTestServerTransport } from '../../packages/playwright/lib/isomorphic/testServerConnection';
class TestServerConnectionUnderTest extends TestServerConnection {
events: [string, any][] = [];
constructor(wsUrl: string) {
super(wsUrl);
super(new WebSocketTestServerTransport(wsUrl));
this.onTestFilesChanged(params => this.events.push(['testFilesChanged', params]));
this.onStdio(params => this.events.push(['stdio', params]));
this.onLoadTraceRequested(params => this.events.push(['loadTraceRequested', params]));