Need advice about which tool to choose?Ask the StackShare community!
As we all know testing is an important part of any application. To assist with our testing we are going to use both Cypress and Jest. We feel these tools complement each other and will help us get good coverage of our code. We will use Cypress for our end to end testing as we've found it quite user friendly. Jest will be used for our unit tests because we've seen how many larger companies use it with great success.
Postman will be used to do integration testing with the backend API we create. It offers a clean interface to create many requests, and you can even organize these requests into collections. It helps to test the backend API first to make sure it's working before using it in the front-end. Jest can also be used for testing and is already embedded into React. Not only does it offer unit testing support in javascript, it can also do snapshot testing for the front-end to make sure components are rendering correctly. Enzyme is complementary to Jest and offers more functions such as shallow rendering. UnitTest will be used for Python testing as it is simple, has a lot of functionality and already built in with python. Sentry will be used for keeping track of errors as it is also easily integratable with Heroku because they offer it as an add-on. LogDNA will be used for tracking logs which are not errors and is also a Heroku add-on. Its good to have a separate service to record logs, monitor, track and even fix errors in real-time so our application can run more smoothly.
We use Mocha for our FDA verification testing. It's integrated into Meteor, our upstream web application framework. We like how battle tested it is, its' syntax, its' options of reporters, and countless other features. Most everybody can agree on mocha, and that gets us half-way through our FDA verification and validation (V&V) testing strategy.
Pros of Enzyme
Pros of Jest
- Open source33
- Mock by default makes testing much simpler29
- Testing React Native Apps21
- Parallel test running18
- Fast14
- Bundled with JSDOM to enable DOM testing12
- Mock by default screws up your classes, breaking tests7
- Out of the box code coverage7
- Promise support6
- One stop shop for unit testing6
- Great documentation3
- Assert Library Included1
- Built in watch option with interactive filtering menu1
- Can be used for BDD0
Pros of Mocha
- Open source134
- Simple100
- Promise support81
- Flexible47
- Easy to add support for Generators28
- For browser and server testing11
- Curstom assertion libraries6
- No other better tools3
- Works with Karma2
- Works with BrowserStack1
- Simple integration testing1
- Simple setup1
- Works with saucelabs1
- Lots of tutorials and help online1
Sign up to add or upvote prosMake informed product decisions
Cons of Enzyme
Cons of Jest
- Many bugs still not fixed months/years after reporting2
- Multiple error messages for same error2
- Bugged1
- Unstable1
- Bad docs1
- Ambiguous1
- Difficult1
- Still does't support .mjs files natively1
- Can't fail beforeAll to abort tests1
- Difficult to run single test/describe/file1
- Documentation1
- Ambiguous configuration1
- Interaction with watch mode on terminal0
- BeforeAll timing out makes all passing tests fail0
Cons of Mocha
- Cannot test a promisified functions without assertion3
- No assertion count in results1