ReactJS and API tests responsibility/resources

ReactJS and API tests responsibility/resources

by Liana Melissa -
Number of replies: 1

Hi all, I've been doing some reading around functional, unit and integration tests for front-end applications and almost all said the testing of the API is up to the back-end developers.

I think writing tests on the front-end to test the API has great benefit because every non-public API I've ever integrated with will make undocumented breaking changes which can bring down your front-end application.

I realise the purpose of the various test types can be opinionated (especially between languages and frameworks) but I'm guessing it will be correct to test the API using functional or integration tests?

Secondly, when it comes to ReactJS + Jest + RxJS are there any good resources covering API tests? All my Googling has only returned writing tests for mock APIs and mostly badly-written tutorials on ReactJS tests.

Thanks.

Average of ratings: -
In reply to Liana Melissa

Re: ReactJS and API tests responsibility/resources

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

In the Moodle world, the way we test teh UI is using something called Behat. How you have that keyword, you should be able to find the relevant info.