markbello / gatsbyjs-nyc

Official Website for the Gatsby NYC Meetup
MIT License
10 stars 7 forks source link

Configure Jest, add unit tests, and perform some minor refactoring of layout code #6

Closed dentemple closed 5 years ago

dentemple commented 5 years ago

In anticipation of the conversion to Typescript, I figured it would be good to have some regression tests. This PR configures Jest & Enzyme and adds some basic test coverage (mostly on the code I modified in a previous PR).

I'm no expert on testing Gatsby, so feel free to adjust, overwrite, or reject this setup.

One thing that this PR doesn't handle is testing components that use StaticQuery. I have no clue how to solve that problem right now.

Also, I can squash these three commits if you want me to.

Cheers

markbello commented 5 years ago

thanks! can you squash and point the PR to develop? netlify hooks into master branch to auto-build, so im trying to move us towards PR-ing into develop. that we can test locally before releasing changes to a prod environment :)

dentemple commented 5 years ago

Done and done