This is an application developed to demonstrate technical proficiency in building and testing a React application.
- Run
pnpm devto run the application.
- Run
pnpm vitestto run the unit tests.
- I choose
pnpmas the package manager because its fast and disk-efficient. Instead of duplication dependencies in every project'snode_modulesfolder, it downloads packages to a single global store and creates hard links to them.
Viteis a fast frontend build tool that makes the development environment very fast and optimize the code for production.
- I didn't choose it, it's the required lib of the challenge. But it's curently my main stack so I can talk a little bit about it.
Reactis one of the most used technologies of the world, it's very popular because of its ecosystem(community, libraries, tutorials and job opportunities), and versatility on creating applications as SPA's. - Talking about
Typescript, it's an open-source, statically typed superset ofJavaScriptdeveloped by Microsoft that makes our lovedJavaScriptget typed strongly improving the code development experience.
Vitestwas created to make testing just work forViteapps. By building on top ofVite,Vitestnatively understands yourViteconfig and is able to reuse the same resolve and transform pipelines.- To simulate a browser and create an environment to test the application I choose
jsdom, that is a library recommended by thevitestdocumentation. - Testing
JavaScriptprograms in simulated environments such asjsdomorhappy-domhas simplified the test setup and provided an easy-to-use API, making them suitable for many projects and increasing confidence in test results. - The last one but no less important,
React Testing Librarythat was not a choice as well but its the most complete and common tool for testingReactapplications, providing tons of functions for manipulate and getTSXelements.