testing: fix undefined not being reported correctly in results

Fixes #125669
This commit is contained in:
Connor Peet
2021-07-07 14:57:41 -07:00
parent 6e35422648
commit c6d7cfed8a

View File

@@ -224,6 +224,10 @@ function serializeError(err) {
function safeStringify(obj) {
const seen = new Set();
return JSON.stringify(obj, (key, value) => {
if (value === undefined) {
return '[undefined]';
}
if (isObject(value) || Array.isArray(value)) {
if (seen.has(value)) {
return '[Circular]';