FE - Testing Framework
As the product matures, it would be good to look into testing frameworks and get some testing set up before the project grows much larger.
@ajhollid Any plan to setup typescript before adding the testing framework. This would resolve and help us with many errors during compile time itself.
@devamitranjan I would love to migrate the project to typescript, but that's a fairly big job, I'm not sure if we have enough dev-hours available for it at the moment.
This might be something we can undertake when we have a bigger team with more hours to spread around.
Hi! I noticed that testing for the client side hasn’t been set up yet. I wanted to check if anyone is already working on this, as I’m interested in helping set up the testing framework and adding initial unit tests. I’d be happy to propose a setup using Jest and React Testing Library, and add a few example tests to get things started. Please let me know if that sounds good or if someone is already handling this. Thanks!
Hello @saurabhje - that would be great! Currently noone is working on it. As you mentioned, you can come up with a proposal and a few examples and then we go from there.
Thanks! I’ll set up testing with Jest and React Testing Library, and add a couple of example tests for key components. I’ll open a PR soon with the initial setup for review.
Sure, thank you for your follow up here @saurabhje
Just out of curiosity and for my info - is Jest/React Testing Library couple the best fit for this purpose? If you have done any comparisons that would be great so we can have an informed decision for the right tool. Not saying "we should use another" but rather I'm trying to find out the best solution for this purpose.
Upon inspecting the project’s dependencies more carefully, I believe that using Vitest along with React Testing Library would be the best fit for the frontend testing setup. Since the project is built with Vite, Vitest will integrate more naturally and require much less configuration compared to Jest. This makes the testing environment easier and more intuitive to set up. We can use Vitest to handle both unit tests and component tests efficiently.
let me know, what do you think about it?
Upon inspecting the project’s dependencies more carefully, I believe that using Vitest along with React Testing Library would be the best fit for the frontend testing setup. Since the project is built with Vite, Vitest will integrate more naturally and require much less configuration compared to Jest. This makes the testing environment easier and more intuitive to set up. We can use Vitest to handle both unit tests and component tests efficiently.
let me know, what do you think about it?
That sounds good to me. Thanks for the clarification!