anikethsaha / mern

:tada: This is boilerplate for MERN stack with integrations like Redux and SSR :tada:
https://mern.netlify.com
MIT License
98 stars 44 forks source link

Tests written for frontend code #95

Closed anmol5varma closed 4 years ago

anmol5varma commented 4 years ago

@anikethsaha, For now, I have written tests for the client folder. You can view them and give some feedback.

anikethsaha commented 4 years ago

@anmol5varma Thank you for your help. Actually, I have never used enzyme and not even sure whats this shallow thing.

Is it the same as snapshots of jest ?

I just need some time to review it cause I am getting along with enzyme. So I will try my best to review it within a couple of days or hours 😁 .

anikethsaha commented 4 years ago

BTW, this project structure looks much better than a single test folder at root. Thanks for that too 👍

anikethsaha commented 4 years ago

@all-contributors please add @anmol5varma for infrastructure and tests

allcontributors[bot] commented 4 years ago

@anikethsaha

This project's configuration file has malformed JSON: .all-contributorsrc. Error:: Unexpected token ] in JSON at position 708

anikethsaha commented 4 years ago

@all-contributors please add @anmol5varma for infrastructure and tests

allcontributors[bot] commented 4 years ago

@anikethsaha

I've put up a pull request to add @anmol5varma! :tada:

anmol5varma commented 4 years ago

@anikethsaha We can definitely try using render for the simple components but for router wrappers and redux wrappers using render will be a little tricky. We'll have to provide with a lot of mock data. Moreover, since this is boilerplate repo the team using it might not know the difference between render and shallow and mount and the tests might start failing if they add some wrapper modules like redux or routers or the UI elements libraries like material UI or react-bootstrap.

anikethsaha commented 4 years ago

ohhh... yeah that's a thinkable point. OK, we should drop the idea of rendering for now then. 👍