mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
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) {
|
||||
return {
|
||||
error: {
|
||||
message: stripAnsi(error.message),
|
||||
stack: stripAnsi(error.stack),
|
||||
message: stripAnsi(error.message || ''),
|
||||
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'),
|
||||
},
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
@ -1172,7 +1190,7 @@ test('should propagate nested soft errors', async ({ runInlineTest }) => {
|
||||
expect.soft(1).toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
await test.step('second outer', async () => {
|
||||
await test.step('second inner', async () => {
|
||||
expect(1).toBe(2);
|
||||
@ -1267,7 +1285,7 @@ test('should not propagate nested hard errors', async ({ runInlineTest }) => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
await test.step('second outer', async () => {
|
||||
await test.step('second inner', async () => {
|
||||
expect(1).toBe(2);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user