How to use Fake timers with nightwatch.js and sinon.js?
<p>I'm doing JavaScript e2e test with nightwatch.js, and I want to mock the clock with sinon.js's fake timer <a href="http://sinonjs.org/docs/#clock" rel="nofollow">http://sinonjs.org/docs/#clock</a></p>

<p>But test stops before finish it, I got the log like below, and doesn't progress anymore.</p>

<pre><code>[some test] Test Suite
===============================
 ✔ Element &lt;body&gt; was visible after 5000 milliseconds. 
</code></pre>

<p>My test code is like below. How can I solve the problem? Thank you.</p>

<pre><code>module.exports = {
  before: function(browser) {
    clock = sinon.useFakeTimers(new Date(2015, 7, 20).getTime());
  },

  after: function(browser) {
    clock.restore();
    browser.end();
  },

  'some test': function(browser) {
    const browserName = this.client.options.desiredCapabilities.browserName;

    browser
      .url('some/path/')
      .waitForElementVisible('body', 5000)
      .pause(5000); // I need to use pause here

    clock.tick(5001);

    browser
      .expect.element('.someElement').to.be.enabled;
  },
};
</code></pre>