From b65f5a4d3091cce5838e1eefcc94dc3a336c3ca9 Mon Sep 17 00:00:00 2001 From: petehunt Date: Fri, 14 Feb 2014 12:55:03 -0800 Subject: [PATCH] fix tests --- .../__tests__/ReactCSSTransitionGroup-test.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/addons/transitions/__tests__/ReactCSSTransitionGroup-test.js b/src/addons/transitions/__tests__/ReactCSSTransitionGroup-test.js index 07e5c01f52..dac65653ba 100644 --- a/src/addons/transitions/__tests__/ReactCSSTransitionGroup-test.js +++ b/src/addons/transitions/__tests__/ReactCSSTransitionGroup-test.js @@ -58,7 +58,15 @@ describe('ReactCSSTransitionGroup', function() { expect(a.getDOMNode().childNodes[1].id).toBe('one'); console.warn = mocks.getMockFunction(); - setTimeout.mock.calls[2][0](); + + // For some reason jst is adding extra setTimeout()s and grunt test isn't, + // so we need to do this disgusting hack. + for (var i = 0 ; i < setTimeout.mock.calls.length; i++) { + if (setTimeout.mock.calls[i][1] === 5000) { + setTimeout.mock.calls[i][0](); + break; + } + } expect(a.getDOMNode().childNodes.length).toBe(2); expect(console.warn.mock.calls.length).toBe(1);