crisisboard / opencrisisboard

OpenCrisisBoard (OCB) is an open-source, self-hosted communications board where communities can organize around local information
https://opencrisisboard.org/
MIT License
48 stars 17 forks source link

Install unit test framework for frontend, get started on writing unit tests #10

Open aPruner opened 4 years ago

aPruner commented 4 years ago

At this point, the app doesn't have a test framework installed for frontend unit tests. Let's get this installed and some quality tests written for our react components.

I recommend that we setup unit testing with Jest and Enzyme. Here's a good tutorial to follow that can greatly help with getting these tests up and running: https://scotch.io/tutorials/testing-react-components-with-enzyme-and-jest

Let's focus on react component tests first.

jpowersdev commented 4 years ago

I'd be interested in getting involved with this, and I'm happy to use Jest and Enzyme.

aPruner commented 4 years ago

@jpowersdev awesome! Please read the CONTRIBUTING.md doc before assigning the issue to yourself. :)

aPruner commented 4 years ago

@jpowersdev also, after a real quick peek into the root package.json it looks like we've already got jest installed, but no enzyme. I also believe there is one .test.js file in the project somewhere but I'm not sure if tests have actually been written. Please feel free to dig around, write some tests, and open a PR! Thanks for your help.

jpowersdev commented 4 years ago

Will do, thank you!