fix(log): include log name in progress recording (#2550)

This commit is contained in:
Dmitry Gozman 2020-06-12 09:48:56 -07:00 committed by GitHub
parent fb0b910ed7
commit 1bf9e65ef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -84,7 +84,7 @@ export class ProgressController {
}, },
log: (log: Log, message: string | Error) => { log: (log: Log, message: string | Error) => {
if (this._state === 'running') { if (this._state === 'running') {
this._logRecording.push(message.toString()); this._logRecording.push(`[${log.name}] ${message.toString()}`);
this._logger.log(log, ' ' + message); this._logger.log(log, ' ' + message);
} else { } else {
this._logger.log(log, message); this._logger.log(log, message);

View File

@ -54,6 +54,8 @@ describe('Playwright', function() {
const options = { ...defaultBrowserOptions, timeout: 5000, __testHookBeforeCreateBrowser: () => new Promise(f => setTimeout(f, 6000)) }; const options = { ...defaultBrowserOptions, timeout: 5000, __testHookBeforeCreateBrowser: () => new Promise(f => setTimeout(f, 6000)) };
const error = await browserType.launch(options).catch(e => e); const error = await browserType.launch(options).catch(e => e);
expect(error.message).toContain(`Timeout 5000ms exceeded during ${browserType.name()}.launch.`); expect(error.message).toContain(`Timeout 5000ms exceeded during ${browserType.name()}.launch.`);
expect(error.message).toContain(`[browser] <launching>`);
expect(error.message).toContain(`[browser] <launched> pid=`);
}); });
it('should handle exception', async({browserType, defaultBrowserOptions}) => { it('should handle exception', async({browserType, defaultBrowserOptions}) => {
const e = new Error('Dummy'); const e = new Error('Dummy');