Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix environment variable requirement and TypeError
Adds unit tests for handling workflow run statuses and updates Jest configuration for testing. - **Unit Tests**: Implements tests in `__tests__/required.test.ts` to simulate different scenarios including all required statuses completing successfully, only one required status reporting success, one required status reporting failure, and a replication lag scenario. Each test checks if the correct commit status is created with the expected state and description. - **Environment Variable**: Sets the `GITHUB_REPOSITORY` environment variable in the test setup to mimic the GitHub Actions environment. - **Error Handling**: Adds error handling in the mocked `listWorkflowRunsForRepo` method to simulate a scenario where `data` is undefined, preventing `TypeError`. - **Jest Configuration**: Modifies the `ci-test` and `test` scripts in `package.json` to use Jest for running tests and generating coverage reports. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/urcomputeringpal/optional-required-workflows/pull/9?shareId=dcb656a4-22f3-448f-a591-6dd98310352a).
- Loading branch information