hammerlab/cycledash — pull request #105 by danvk (2014-10-08 00:57:08+00:00)
Title: A jest test for ExaminePage

This fixes #48 for the second time and adds a regression test.

The test was quite tricky to get right, but I'm happy with how it turned out. And the first one is always the hardest: by copy/pasting some of the boilerplate from ExaminePage-test.js, we should be able to write tests for other components fairly easily.

Highlights:
- I switched our tests over to Jest. I don't love it, but it seems to be standard for ReactJS.
- For why I changed `require('d3')` to `require('d3/d3')`, see [this issue](https://github.com/facebook/jest/issues/83#issue-36939736).
- This PR adds a ten row VCF file as test data. It uses a Jasmine Spy to intercept `ExaminePage`'s XHR attempts and return the test data instead.
- The way that Jest intercepts `require`s means that the test loads modules in a slightly odd way.