Skip to content

Commit

Permalink
test: Print "null" and "undefined" nicely with Chromium
Browse files Browse the repository at this point in the history
The fallbacks would print null as '???' and undefined as
'{"type":"undefined"}'.
  • Loading branch information
mvollmer committed Nov 8, 2023
1 parent 87c798b commit 6b6dbed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/common/chromium-cdp-driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ function stringifyConsoleArg(arg) {
try {
if (arg.type === 'string')
return arg.value;
if (arg.type === 'object') {
if (arg.type === 'undefined')
return "undefined";
if (arg.value === null)
return "null";
if (type === 'object') {
const obj = {};
arg.preview.properties.forEach(prop => {
obj[prop.name] = prop.value.toString();
Expand Down

0 comments on commit 6b6dbed

Please sign in to comment.