oss-slu / esp

MIT License
0 stars 5 forks source link

Add frontend unit test GitHub Action #80

Open SiriChandanaGarimella opened 1 month ago

SiriChandanaGarimella commented 1 month ago

Is your feature request related to a problem? Please describe. Our project currently lacks automated running of front-end unit tests in the CI/CD pipeline. This can lead to undetected bugs and regressions in the front-end code.

Describe the solution you'd like Implement a GitHub Actions workflow to automatically run frontend (React.js) unit tests on every pull request and push to the main branch.

Acceptance Criteria

  1. Create a GitHub Actions workflow file (e.g., frontend-tests.yml) in the .github/workflows/ directory.
  2. The workflow should trigger on pull requests to the main branch and on pushes to the main branch.
  3. The workflow should:
    • Set up the Node.js environment (use the project's required Node.js version)
    • Install dependencies using npm or yarn (as per project configuration)
    • Run the frontend unit tests (typically using Jest for React applications)
  4. Configure the test runner to generate a coverage report.
  5. The workflow should fail if any tests fail.
  6. Test results and coverage reports should be visible in the GitHub Actions log.

Additional context This issue should be picked up only after the issue #47 is completed