How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • const assert = require('assert');
    
    // Creates call tracker.
    const tracker = new assert.CallTracker();
    
    function func() {}
    
    // Returns a function that wraps func() that must be called exact times
    // before tracker.verify().
    const callsfunc = tracker.calls(func, 2);
    
    callsfunc();
    
    // Will throw an error since callsfunc() was only called once.
    tracker.verify();
    Docs
  • const assert = require('assert');
    
    const tracker = new assert.CallTracker();
    
    function func() {}
    
    // callsfunc() must be called exactly 1 time before tracker.verify().
    const callsfunc = tracker.calls(func, 1);
    
    callsfunc();
    
    // Calls tracker.verify() and verifies if all tracker.calls() functions have
    // been called exact times.
    process.on('exit', () => {
      tracker.verify();
    });
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples