From 212bd2250cb780e1e8d422a85a5851c9321fa640 Mon Sep 17 00:00:00 2001 From: James Ide Date: Fri, 22 May 2015 23:58:02 -0700 Subject: [PATCH] [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 some 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. Test Plan: Run `npm test` with the latest version of jest. --- .travis.yml | 4 ++-- package.json | 2 +- .../react-packager/src/JSTransformer/__tests__/Cache-test.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7da54bdf4..eea5a4eaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,13 +15,13 @@ install: - cp $(brew --prefix nvm)/nvm-exec .nvm/ - export NVM_DIR=.nvm - source $(brew --prefix nvm)/nvm.sh - - nvm install v0.10 + - nvm install iojs-v2 - npm config set spin=false - npm install script: - | - nvm use v0.10 + nvm use iojs-v2 if [ "$TEST_TYPE" = objc ] then diff --git a/package.json b/package.json index 13c57fbeb..41c6b5869 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "yargs": "1.3.2" }, "devDependencies": { - "jest-cli": "0.4.5", + "jest-cli": "facebook/jest#0.5.x", "babel-eslint": "3.1.5", "eslint": "0.21.2", "eslint-plugin-react": "2.3.0" diff --git a/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js b/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js index 3877b3dd5..df3ccfd7e 100644 --- a/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js +++ b/packager/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(); }); });