november9 / wecansavedemocracy

A simple mobile and tablet-friendly web app to help get citizens in the habit of taking peaceful political action towards progressive causes.
GNU General Public License v3.0
10 stars 3 forks source link

Test setup #36

Closed jktravis closed 7 years ago

jktravis commented 7 years ago
  1. Added in enzyme for component testing.
  2. Renamed test folder to tools and placed a test_setup file there.
  3. Wrote two tests, one for a reducer and another for a component to confirm this works.
  4. Added code coverage

I'm in favor of co-locating tests with the files that are being tested. It often makes things easier to navigate in my opinion. Feel free to recreate a test folder and move the tests there.

Code coverage data is stored in the .nyc_output folder. The HTML representation is in the coverage folder. These are ignored in git because they are rewritten after every test. To update the data, simply run npm test. To update the HTML report, run npm run test:report. I decided not to put this on posttest since the output is a little verbose, and it might cause people to overlook failing tests.

I didn't write a test for any of the jQuery stuff that was in the original file.

november9 commented 7 years ago

Hey there @jktravis - man, THANK YOU so much for all of this great work! I'm on my way out the door right now, but I'll take a look at all of these PR's when I get back later this afternoon.

I just wanted to give you the heads-up asap that I saw these and really, really appreciate it. :)