test: enhance console error logging with type tags
This commit is contained in:
parent
39beed3172
commit
16d9a0e205
@ -23,9 +23,9 @@ test.describe('Web Component E2E Tests', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
if (!subscribedToAppErrors) {
|
||||
page.on('console', (msg) => {
|
||||
if (msg.type() === 'error') {
|
||||
console.error(`Console Error: ${msg.text()}`);
|
||||
}
|
||||
const type = msg.type();
|
||||
const tag = type === 'error' ? 'ERROR' : type === 'warning' ? 'WARNING' : 'LOG';
|
||||
console.log('[' + tag + ']', msg.text());
|
||||
});
|
||||
subscribedToAppErrors = true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user