reach4help / covidhelphub-frontend

MIT License
1 stars 3 forks source link

Add Navbar jest test #64

Closed pratikmdhr closed 2 years ago

pratikmdhr commented 2 years ago

Reconfigured Jest and added Navbar Unit Test

1. Reconfigured typescript definitions for cypress and jest Since Cypress and Jest share some common namespaces, separate tsconfig file was created for cypress in order to avoid conflict. So the tsconfig file in the root directory will be used for Jest and the one in Cypress folder will be used for Cypress. More details in the documentation: https://docs.cypress.io/guides/tooling/typescript-support#Configure-tsconfig-json

2. Installed ts-jest package and configured babel and jest config files As per documentation, Jest supports TypeScript via Babel, but it is purely transpilation and Jest doesnt type check the tests as they are run. So installed ts-jest package as suggested in the docs. More on this: https://jestjs.io/docs/getting-started#using-typescript

3. Added unit test for the Navbar To run: yarn test NavBar.test.tsx

Closes #41

jensren commented 2 years ago

Would you mind fixing the merge conflicts? I am not sure which versions you want in the yarn.lock

pratikmdhr commented 2 years ago

Would you mind fixing the merge conflicts? I am not sure which versions you want in the yarn.lock

sure, i resolved the conflicts