Skip to content

Commit 585f8db

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 5ee24bf commit 585f8db

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ install:
1515
- cp $(brew --prefix nvm)/nvm-exec .nvm/
1616
- export NVM_DIR=.nvm
1717
- source $(brew --prefix nvm)/nvm.sh
18-
- nvm install v0.10
18+
- nvm install iojs-v2.2
1919
- npm config set spin=false
2020
- npm install
2121

2222
script:
2323
- |
24-
nvm use v0.10
24+
nvm use iojs-v2.2
2525
2626
if [ "$TEST_TYPE" = objc ]
2727
then

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"yargs": "1.3.2"
7171
},
7272
"devDependencies": {
73-
"jest-cli": "0.4.5",
73+
"jest-cli": "ide/jest#iojs",
7474
"babel-eslint": "3.1.5",
7575
"eslint": "0.21.2",
7676
"eslint-plugin-react": "2.3.0"

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)