Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/test/webServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const DEFAULT_ENVIRONMENT_VARIABLES = {

const newProcessLogPrefixer = () => new stream.Transform({
transform(this: stream.Transform, chunk: Buffer, encoding: string, callback: stream.TransformCallback) {
this.push(chunk.toString().split(os.EOL).map((line: string): string => line ? `[Launch] ${line}` : line).join(os.EOL));
this.push(chunk.toString().split(os.EOL).map((line: string): string => line ? `[WebServer] ${line}` : line).join(os.EOL));
callback();
},
});
Expand Down Expand Up @@ -58,7 +58,7 @@ export class WebServer {
if (portIsUsed) {
if (this.config.reuseExistingServer)
return;
throw new Error(`Port ${this.config.port} is used, make sure that nothing is running on the port or set strict:false in config.launch.`);
throw new Error(`Port ${this.config.port} is used, make sure that nothing is running on the port or set strict:false in config.webServer.`);
}

const { launchedProcess, kill } = await launchProcess({
Expand All @@ -73,7 +73,7 @@ export class WebServer {
shell: true,
attemptToGracefullyClose: async () => {},
log: () => {},
onExit: code => processExitedReject(new Error(`Process from config.launch was not able to start. Exit code: ${code}`)),
onExit: code => processExitedReject(new Error(`Process from config.webServer was not able to start. Exit code: ${code}`)),
tempDirectories: [],
});
this._killProcess = kill;
Expand All @@ -97,7 +97,7 @@ export class WebServer {
]));
cancellationToken.canceled = true;
if (timedOut)
throw new Error(`Timed out waiting ${launchTimeout}ms from config.launch.`);
throw new Error(`Timed out waiting ${launchTimeout}ms from config.webServer.`);
}
public async kill() {
await this._killProcess?.();
Expand Down
4 changes: 2 additions & 2 deletions tests/playwright-test/web-server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test('should time out waiting for a server', async ({ runInlineTest }, { workerI
`,
});
expect(result.exitCode).toBe(1);
expect(result.output).toContain(`Timed out waiting 100ms from config.launch.`);
expect(result.output).toContain(`Timed out waiting 100ms from config.webServer.`);
});

test('should be able to specify the baseURL without the server', async ({ runInlineTest }, { workerIndex }) => {
Expand Down Expand Up @@ -190,7 +190,7 @@ test('should be able to use an existing server when reuseExistingServer:true ',
});
expect(result.exitCode).toBe(0);
expect(result.passed).toBe(1);
expect(result.output).not.toContain('[Launch] ');
expect(result.output).not.toContain('[WebServer] ');
expect(result.report.suites[0].specs[0].tests[0].results[0].status).toContain('passed');
await new Promise(resolve => server.close(resolve));
});
Expand Down