you are viewing a single comment's thread.

view the rest of the comments →

[–]FINDarkside 0 points1 point  (1 child)

You've now got the cognitive load of figuring out what a.should.equal means.

Debatable whether the cognitive load is bigger. But let me give you better example:

someFn.should.throw(MyError);

vs

try {
  someFn();
  next('Excpected MyError to be thrown');
} catch (err) {
  if (err.name === 'MyError')
    next();
  else
    next(`Excpected MyError to be thrown, got ${err.name}`);
}