SMARTJ is a web application designed to help active job seekers practice their interview skills and find available jobs in their field of study. Developed by Team 4 as part of the SOFTENG 310 course at the University of Auckland.
Configured a proper setup for writing unit tests using Jest and React Testing Library. This work is important for writing and running tests in future development.
What Changed?
Created a __tests__ directory within src to house our test files.
Moved App.test.js and created Home.test.js within this new directory.
Implemented basic tests for App and Home components to ensure they render without crashing.
How To Review
Clone the branch and install dependencies with npm install.
Run npm test in the project root to execute the smoke tests for App.js and Home.js.
Verify that both tests pass without errors.
Testing
Executed npm test in the project root to confirm all tests run successfully.
Verified that no additional dependencies were required to run the tests.
Risks
Low risk as this PR only adds tests without modifying existing functionality.
Reviewers should ensure that npm test runs without requiring additional setup or dependencies.
Notes
Jest and React Testing Library were already configured within our Create React App setup. No modifications to package.json or package-lock.json were necessary.
npm test -- --coverage can be used to check test coverage
Next Steps
Expand test coverage by adding more detailed tests for Home and App components.
Create similar basic tests for other key components in our application.
Consider adding integration tests as the application grows in complexity.
Add Basic Tests for Basic Component Rendering
Context
Configured a proper setup for writing unit tests using Jest and React Testing Library. This work is important for writing and running tests in future development.
What Changed?
__tests__
directory withinsrc
to house our test files.App.test.js
and createdHome.test.js
within this new directory.App
andHome
components to ensure they render without crashing.How To Review
npm install
.npm test
in the project root to execute the smoke tests for App.js and Home.js.Testing
npm test
in the project root to confirm all tests run successfully.Risks
npm test
runs without requiring additional setup or dependencies.Notes
package.json
orpackage-lock.json
were necessary.npm test -- --coverage
can be used to check test coverageNext Steps
Home
andApp
components.