title: Stub for a function in Nodejs not executing
body: <p>This is a call to a library function,</p>
  <pre><code>this.db.update(contactsCollection, ...query);
  </code></pre>
  <p>And this is the stub I wrote.</p>
  <pre><code>updateStub = sandbox.stub(preferencesController.db, 'update').resolves({ modifiedCount: 1 });
  </code></pre>
  <p>The stub executes successfully if I remove the spread (...) operator. But in the current scenario, it throws the following error - &quot;found non-callable @@iterator&quot;</p>
  <p>Is there a different way to stub a function with variable number of arguments?</p>