test: fix a broken reporter test (#29514)
It failed to print an error with missing stack, e.g. a timeout error.
This commit is contained in:
parent
09d0a099a2
commit
bc2d4302f5
|
|
@ -47,8 +47,8 @@ class Reporter {
|
||||||
distillError(error) {
|
distillError(error) {
|
||||||
return {
|
return {
|
||||||
error: {
|
error: {
|
||||||
message: stripAnsi(error.message),
|
message: stripAnsi(error.message || ''),
|
||||||
stack: stripAnsi(error.stack),
|
stack: stripAnsi(error.stack || ''),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -351,6 +351,12 @@ test('should not report nested after hooks', async ({ runInlineTest }) => {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
error: {
|
||||||
|
message: 'Test timeout of 2000ms exceeded.',
|
||||||
|
stack: ''
|
||||||
|
},
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -972,6 +978,18 @@ test('should not mark page.close as failed when page.click fails', async ({ runI
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
error: {
|
||||||
|
message: 'Test timeout of 2000ms exceeded.',
|
||||||
|
stack: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
error: {
|
||||||
|
message: expect.stringContaining('Error: page.click'),
|
||||||
|
stack: expect.stringContaining('Error: page.click'),
|
||||||
|
},
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue