[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.
This commit is contained in:
James Ide
2015-05-22 23:58:02 -07:00
parent 951b5f9517
commit 212bd2250c
3 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -229,7 +229,7 @@ describe('JSTransformer Cache', function() {
return Promise.resolve('baz value');
});
jest.runAllTicks();
jest.runAllImmediates();
expect(fs.writeFile).toBeCalled();
});
});