How to write tests for a React app that use hooks
Find a file
2025-10-25 10:28:08 +02:00
back Fix README and package.json 2025-10-25 10:28:08 +02:00
front Rewrite backend in typescript too 2025-10-25 10:25:55 +02:00
README.md Fix README and package.json 2025-10-25 10:28:08 +02:00

React hooks testing

Setup

Prerequisites: node

Start the back-end:

cd back/
npm run start

Start the front-end (in an other terminal)

cd front/
npm install
npm run front:dev

Run the tests:

npm run test

Instructions

There are unit tests for the Footer component, but they're no business logic there!

How can we add automatic tests for the ShowFact component ?