Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
  • Loading branch information
voxpelli and JoshuaKGoldberg committed Feb 27, 2024
1 parent 0ec8b7d commit 04f7008
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/reporters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ var generateDiff = (exports.generateDiff = function (actual, expected) {
* @return {{ message: string, msg: string, stack: string }}
*/
var getFullErrorStack = function (err, seen) {
if (seen && seen.has(err)) {
if (seen?.has(err)) {
return { message: '', msg: '<circular>', stack: '' };
}

Expand Down
2 changes: 1 addition & 1 deletion lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ Runner.prototype.fail = function (test, err, force) {
const alreadyFiltered = new Set();
let currentErr = err;

while (currentErr && currentErr.stack && !alreadyFiltered.has(currentErr)) {
while (currentErr?.stack && !alreadyFiltered.has(currentErr)) {
alreadyFiltered.add(currentErr);

try {
Expand Down

0 comments on commit 04f7008

Please sign in to comment.