Skip to content

Commit 1cd4b11

Browse files
committed
[Tests] Update tests to run on io.js with the latest version of jest
Updates the tests in small ways so they run on io.js with two updates: - The animation tests use `toBeCloseTo` since there are small math discrepancies between versions of V8 - The Cache test which relies on Promises uses `runAllImmediates` for modern versions of Node because bluebird uses `setImmediate` instead of `process.nextTick` for Node >0.10. Test Plan: Run `npm test` with the latest version of jest.
1 parent 4673dca commit 1cd4b11

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Libraries/Animation/__tests__/AnimationUtils-test.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packager/react-packager/src/JSTransformer/__tests__/Cache-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ describe('JSTransformer Cache', function() {
229229
return Promise.resolve('baz value');
230230
});
231231

232-
jest.runAllTicks();
232+
jest.runAllTicks(); // Node 0.10 (bluebird uses nextTick)
233+
jest.runAllImmediates(); // Node 0.12+
233234
expect(fs.writeFile).toBeCalled();
234235
});
235236
});

0 commit comments

Comments
 (0)