• Home
  • Raw
  • Download

Lines Matching refs:tracker

239 were called a specific number of times. The `tracker.verify()` must be called
247 const tracker = new assert.CallTracker();
251 // callsfunc() must be called exactly 1 time before tracker.verify().
252 const callsfunc = tracker.calls(func, 1);
256 // Calls tracker.verify() and verifies if all tracker.calls() functions have
259 tracker.verify();
266 const tracker = new assert.CallTracker();
270 // callsfunc() must be called exactly 1 time before tracker.verify().
271 const callsfunc = tracker.calls(func, 1);
275 // Calls tracker.verify() and verifies if all tracker.calls() functions have
278 tracker.verify();
282 ### `tracker.calls([fn][, exact])`
296 [`tracker.verify()`][] is called, then [`tracker.verify()`][] will throw an
302 // Creates call tracker.
303 const tracker = new assert.CallTracker();
308 // before tracker.verify().
309 const callsfunc = tracker.calls(func);
315 // Creates call tracker.
316 const tracker = new assert.CallTracker();
321 // before tracker.verify().
322 const callsfunc = tracker.calls(func);
325 ### `tracker.getCalls(fn)`
342 const tracker = new assert.CallTracker();
345 const callsfunc = tracker.calls(func);
348 assert.deepStrictEqual(tracker.getCalls(callsfunc),
355 // Creates call tracker.
356 const tracker = new assert.CallTracker();
359 const callsfunc = tracker.calls(func);
362 assert.deepStrictEqual(tracker.getCalls(callsfunc),
366 ### `tracker.report()`
375 returned by [`tracker.calls()`][].
390 // Creates call tracker.
391 const tracker = new assert.CallTracker();
396 // before tracker.verify().
397 const callsfunc = tracker.calls(func, 2);
400 console.log(tracker.report());
416 // Creates call tracker.
417 const tracker = new assert.CallTracker();
422 // before tracker.verify().
423 const callsfunc = tracker.calls(func, 2);
426 console.log(tracker.report());
439 ### `tracker.reset([fn])`
447 Reset calls of the call tracker.
454 const tracker = new assert.CallTracker();
457 const callsfunc = tracker.calls(func);
461 assert.strictEqual(tracker.getCalls(callsfunc).length, 1);
463 tracker.reset(callsfunc);
464 assert.strictEqual(tracker.getCalls(callsfunc).length, 0);
470 const tracker = new assert.CallTracker();
473 const callsfunc = tracker.calls(func);
477 assert.strictEqual(tracker.getCalls(callsfunc).length, 1);
479 tracker.reset(callsfunc);
480 assert.strictEqual(tracker.getCalls(callsfunc).length, 0);
483 ### `tracker.verify()`
492 [`tracker.calls()`][] and will throw an error for functions that
498 // Creates call tracker.
499 const tracker = new assert.CallTracker();
504 // before tracker.verify().
505 const callsfunc = tracker.calls(func, 2);
510 tracker.verify();
516 // Creates call tracker.
517 const tracker = new assert.CallTracker();
522 // before tracker.verify().
523 const callsfunc = tracker.calls(func, 2);
528 tracker.verify();
2559 [`tracker.calls()`]: #trackercallsfn-exact
2560 [`tracker.verify()`]: #trackerverify