mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
[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:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -229,7 +229,7 @@ describe('JSTransformer Cache', function() {
|
||||
return Promise.resolve('baz value');
|
||||
});
|
||||
|
||||
jest.runAllTicks();
|
||||
jest.runAllImmediates();
|
||||
expect(fs.writeFile).toBeCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user