Skip to content

Commit

Permalink
Increase CI tests stability by replacing window.requestAnimationFrame…
Browse files Browse the repository at this point in the history
… with setTimeout in tests. (#175)
  • Loading branch information
Hypnosphi authored and joshwcomeau committed Aug 28, 2017
1 parent 5a71051 commit 89201dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ describe('FlipMove', () => {
let finishAllStub;

before(() => {
sinon.stub(window, 'requestAnimationFrame', cb => setTimeout(cb, 0));
consoleStub = sinon.stub(console, 'error');
finishAllStub = sinon.stub();
});
afterEach(() => {
consoleStub.reset();
finishAllStub.reset();
});
after(() => consoleStub.restore());
after(() => {
window.requestAnimationFrame.restore();
consoleStub.restore();
});

// To test this, here is our setup:
// We're making a simple list of news articles, with the ability to
Expand Down

0 comments on commit 89201dd

Please sign in to comment.