fix tests
petehunt committed
Feb 14, 2014 at 12:55 UTC
b65f5a4d3091cce5838e1eefcc94dc3a336c3ca9
1 file changed
+9
-1
src/addons/transitions/__tests__/ReactCSSTransitionGroup-test.js
+9
-1
@@ -58,7 +58,15 @@ describe('ReactCSSTransitionGroup', function() {
58
expect(a.getDOMNode().childNodes[1].id).toBe('one');
59
60
console.warn = mocks.getMockFunction();
61
- setTimeout.mock.calls[2][0]();
61
+
62
+ // For some reason jst is adding extra setTimeout()s and grunt test isn't,
63
+ // so we need to do this disgusting hack.
64
+ for (var i = 0 ; i < setTimeout.mock.calls.length; i++) {
65
+ if (setTimeout.mock.calls[i][1] === 5000) {
66
+ setTimeout.mock.calls[i][0]();
67
+ break;
68
+ }
69
+ }
70
71
expect(a.getDOMNode().childNodes.length).toBe(2);
72
expect(console.warn.mock.calls.length).toBe(1);