Skip to content

Commit

Permalink
[Tests] Update tests to run on io.js with the latest version of jest
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ide committed May 23, 2015
1 parent 4673dca commit 627af26
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ cache:
before_install:
- brew update
install:
- brew reinstall flow xctool
- brew reinstall flow iojs xctool
- brew unlink node && brew link --force iojs
- npm config set spin=false
- npm install

Expand Down
6 changes: 4 additions & 2 deletions Libraries/Animation/__tests__/AnimationUtils-test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"yargs": "1.3.2"
},
"devDependencies": {
"jest-cli": "0.4.5",
"jest-cli": "ide/jest#iojs",
"eslint": "0.9.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ describe('JSTransformer Cache', function() {
return Promise.resolve('baz value');
});

jest.runAllTicks();
jest.runAllTicks(); // Node 0.10 (bluebird uses nextTick)
jest.runAllImmediates(); // Node 0.12+
expect(fs.writeFile).toBeCalled();
});
});
Expand Down

0 comments on commit 627af26

Please sign in to comment.