3 ms·
I find mockable end-to-end testing for React-based SPAs to be quite a mess. On the one hand, "React is a just a view library" so e2e testing is orthogonal. On t
by bayonetz 10y ago
I find mockable end-to-end testing for React-based SPAs to be quite a mess. On the one hand, "React is a just a view library" so e2e testing is orthogonal. On the other hand, Redux/Flux + React pretty much get treated as the counterpart to traditional MVC and the infrastructure upon which you build your whole app on. But unlike Ember with it's QUnit e2e helpers or Protractor for Angular, there is nothing like that for e2e testing a "React [+ Redux/Flux]" app. Unit testing with TestItils/Enzyme/Jest definitely doesn't cut it. You can unit test all day but the isn't the same as integration and acceptance-type testing. We had to basically roll our own using WebDriver.IO and injecting a fetch-mock helper into our app to mock out the external API calls. That last part is key when you need to test your complex SPA without having to rely on backend API servers. Anbody else feel this pain?
- Zalastax 10y agoYou're completely right! It's unfortunate but the tooling for e2e tests isn't "there" yet. For now the best alternative is Selenium (which I've had a lot of trouble with getting stable) or https://github.com/DevExpress/testcafe https://github.com/DevExpress/testcafe