Skip to content

Commit

Permalink
fixup! tools: improve valid-typeof lint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Mar 26, 2021
1 parent 7731da8 commit 2392f36
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions test/parallel/test-assert-calltracker-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,16 @@ function foo() {}
const callsfoo = tracker.calls(foo, 1);

// Ensures that foo was added to the callChecks array.
if (tracker.report()[0].operator !== 'foo') {
process.exit(1);
}
assert.strictEqual(tracker.report()[0].operator, 'foo');

callsfoo();

// Ensures that foo was removed from the callChecks array after being called the
// expected number of times.
if (typeof tracker.report()[0] === 'undefined') {
process.exit(1);
}
assert.strictEqual(typeof tracker.report()[0], 'undefined');

callsfoo();

// Ensures that foo was added back to the callChecks array after being called
// more than the expected number of times.
if (tracker.report()[0].operator !== 'foo') {
process.exit(1);
}
assert.strictEqual(tracker.report()[0].operator, 'foo');

0 comments on commit 2392f36

Please sign in to comment.