myrjola / neartobeer

Find cheap beers near you
0 stars 0 forks source link

We need tests #6

Closed myrjola closed 7 years ago

myrjola commented 7 years ago

Running npm test only runs eslint. It's nice that it enforces coding conventions, but I think some more tests wouldn't hurt. I just don't know any good testing strategy for React Native and Redux yet. One thing I noticed was that React Native Components won't render locally. They need to be rendered straight to devices or simulators/emulators.

myrjola commented 7 years ago

I added tests for https://github.com/myrjola/beersunderx/blob/master/reducers/walkingDirections.js to https://github.com/myrjola/beersunderx/blob/master/reducers/__tests__/walkingDirections.js following this guide https://blog.callstack.io/unit-testing-react-native-with-the-new-jest-ii-redux-snapshots-for-your-actions-and-reducers-8559f6f8050b. I must say that snapshot based testing is pretty neat.

myrjola commented 7 years ago

We now have CI through https://travis-ci.com/myrjola/beersunderx

Not full test coverage, but we're getting there.