From 62431c7f6295dd53a7eef6710922a92d316e3b25 Mon Sep 17 00:00:00 2001 From: James Ide Date: Wed, 1 Jul 2015 12:52:10 -0700 Subject: [PATCH] [Tests] Update tests to run on io.js with the latest version of jest Summary: [This is a preview diff for getting RN's tests to pass with a future version of jest that supports io.js and other future versions of Node. This can be merged once the diff to update jest is merged upstream and published.] Updates the tests in small ways so they run on io.js with two updates: - 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. Closes https://github.com/facebook/react-native/pull/1382 Github Author: James Ide Test Plan: Run `npm test` with the latest version of jest. --- react-packager/src/JSTransformer/__tests__/Cache-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-packager/src/JSTransformer/__tests__/Cache-test.js b/react-packager/src/JSTransformer/__tests__/Cache-test.js index 3877b3dd..df3ccfd7 100644 --- a/react-packager/src/JSTransformer/__tests__/Cache-test.js +++ b/react-packager/src/JSTransformer/__tests__/Cache-test.js @@ -229,7 +229,7 @@ describe('JSTransformer Cache', function() { return Promise.resolve('baz value'); }); - jest.runAllTicks(); + jest.runAllImmediates(); expect(fs.writeFile).toBeCalled(); }); });