Skip to content

Commit 291a43d

Browse files
wip(tests): more gentle output during tests
1 parent 064795d commit 291a43d

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

tests/testsTools.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,27 @@ async function createPage({ files, processors= {}}) {
6060
const output = [];
6161

6262
page.on('console', async msg => {
63-
console.log("console", msg)
64-
output.push({ type: msg.type(), text: msg.text(), content: await Promise.all( msg.args().map(e => e.jsonValue()) ) })
63+
64+
const entry = { type: msg.type(), text: msg.text(), content: await Promise.all( msg.args().map(e => e.jsonValue()) ) };
65+
if ( isDev )
66+
console.log(entry);
67+
output.push(entry);
6568
} );
69+
6670
page.on('pageerror', error => {
67-
console.log("pageerror", error)
68-
output.push({ type: 'pageerror', text: error.message, content: error })
71+
72+
// Emitted when an uncaught exception happens within the page.
73+
74+
const entry = { type: 'pageerror', text: error.message, content: error };
75+
console.log(entry);
76+
output.push(entry);
6977
} );
78+
7079
page.on('error', msg => {
71-
console.log('error', msg)
80+
81+
// Emitted when the page crashes.
82+
83+
console.log('error', msg);
7284
});
7385

7486
//page.done = new Promise(resolve => page.exposeFunction('_done', resolve));

0 commit comments

Comments
 (0)