Which tool/s do you use to test react projects and why ?
pgangwani

pgangwani @pgangwani

About: Pawan is working as Lead Engineer at JCP, loves to make impact to the customers or masses, comfortable throughout the stack, but presently making difference at front end, node and devops.

Location:
Bangalore
Joined:
Jul 10, 2018

Which tool/s do you use to test react projects and why ?

Publish Date: Jan 17 '19
7 2

This is a discussion.

Which toolset you use in your react projects for unit test, code coverage and e2e test and why ?

Did you ever face a serious problem which made you think to switch other option/alternative?
If yes, what did you do ?

Have you ever went deep into the module and contributed for new issue which nobody else logged (like creating an issue and pull request for it) ?

Please share your experiences. Let's go dev.to learn and share.

Comments 2 total

  • Manuel Spagnolo
    Manuel SpagnoloJan 17, 2019

    1) Unit test (no-render components): mocha/titef
    2) Unit tests (render components): jest + enzyme
    3) Integration tests: jest + enzyme
    4) E2E: wdio (with mocha)

    I am the author of titef*, so 1) can be biased. In 2) I am taking in account snapshot testing. In 3) I am talking about integration between components.

    Excluding titef, I'd use mocha for pretty much everything, but snapshots are extremely convenient, especially when you need to deliver fast. Bottom line, my decision tree goes pretty much like:

    • small project, mostly visual, no much logic -> jest + enzyme and mostly snapshot tests
    • small project, lots of logic, dumb or not-so-relevant UI -> mocha (+ enzyme eventually) and mostly unit tests
    • medium project worth a double setup -> mocha, jest + enzyme and unit tests with snapshots
    • big project -> all the above

    *: The reason why I started titef was that jest is incredibly slow, but I love snapshot testing. I didn't finish it yet, so right now it's just a faster mocha.

Add comment