Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Jul 4, 2022
1 parent d9fd953 commit 2449674
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions lib/internal/assert/calltracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@ class CallTracker {

verify() {
const errors = this.report();
if (!errors.length) {
if (errors.length === 0) {
return;
}
let message = 'Function(s) were not called the expected number of times';
if (errors.length === 1) {
message = errors[0].message;
}
const message = errors.length === 1 ?
errors[0].message :
'Functions were not called the expected number of times';
throw new AssertionError({
message,
details: errors,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-assert-calltracker-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const assert = require('assert');

const tracker = new assert.CallTracker();

const generic_msg = 'Function(s) were not called the expected number of times';
const generic_msg = 'Functions were not called the expected number of times';

function foo() {}

Expand Down

0 comments on commit 2449674

Please sign in to comment.