diff --git a/lib/internal/test_runner/reporter/tap.js b/lib/internal/test_runner/reporter/tap.js index b345d18fc667a3..cd0bbe8ca53003 100644 --- a/lib/internal/test_runner/reporter/tap.js +++ b/lib/internal/test_runner/reporter/tap.js @@ -224,6 +224,9 @@ function jsToYaml(indent, name, value, seen) { } if (errIsAssertion) { + // Note that we're deliberately creating shallow copies of the `seen` + // set here in order to isolate the discovery of circular references + // within the expected and actual properties respectively. result += jsToYaml(indent, 'expected', errExpected, new SafeSet(seen)); result += jsToYaml(indent, 'actual', errActual, new SafeSet(seen)); if (errOperator) {