fix test-server-connection test
This commit is contained in:
parent
577602d95b
commit
17638d08a2
|
|
@ -32,7 +32,7 @@ export interface TestServerTransport {
|
||||||
export class WebSocketTestServerTransport implements TestServerTransport {
|
export class WebSocketTestServerTransport implements TestServerTransport {
|
||||||
private _ws: WebSocket;
|
private _ws: WebSocket;
|
||||||
|
|
||||||
constructor(url: URL) {
|
constructor(url: string | URL) {
|
||||||
this._ws = new WebSocket(url);
|
this._ws = new WebSocket(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@
|
||||||
*/
|
*/
|
||||||
import { test as baseTest, expect } from './ui-mode-fixtures';
|
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 {
|
class TestServerConnectionUnderTest extends TestServerConnection {
|
||||||
events: [string, any][] = [];
|
events: [string, any][] = [];
|
||||||
|
|
||||||
constructor(wsUrl: string) {
|
constructor(wsUrl: string) {
|
||||||
super(wsUrl);
|
super(new WebSocketTestServerTransport(wsUrl));
|
||||||
this.onTestFilesChanged(params => this.events.push(['testFilesChanged', params]));
|
this.onTestFilesChanged(params => this.events.push(['testFilesChanged', params]));
|
||||||
this.onStdio(params => this.events.push(['stdio', params]));
|
this.onStdio(params => this.events.push(['stdio', params]));
|
||||||
this.onLoadTraceRequested(params => this.events.push(['loadTraceRequested', params]));
|
this.onLoadTraceRequested(params => this.events.push(['loadTraceRequested', params]));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue