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 20, 2024
1 parent fa91396 commit c12fd74
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 @@ -220,7 +220,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 @@ -460,7 +460,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 c12fd74

Please sign in to comment.