codecov-browser-extension
codecov-browser-extension copied to clipboard
test: add unit tests generated by ToTheos
AI-Generated Unit Tests
This PR adds AI-generated unit tests to improve coverage and ensure key functionality is tested.
Test coverage summary
Statements : 91.36% ( 307/336 )
Branches : 79.5% ( 97/122 )
Functions : 88.46% ( 46/52 )
Lines : 91.31% ( 305/334 )
Coverage metrics generated by Jest, an open-source JavaScript testing framework.
Test files and commits
test: add configtest: add src/types.test.tstest: add src/background/main.test.tstest: add src/background/dynamic_content_scripts.test.tstest: add src/utils.test.tstest: add src/options/main.test.tsxtest: add src/constants.test.tstest: add src/popup/main.test.tsxtest: add src/content/github/file/utils/dropdown.test.tsxtest: add src/content/github/file/utils/constants.test.tstest: add src/content/github/file/main.test.tsxtest: add src/content/github/pr/constants.test.tstest: add src/content/github/pr/main.test.tsxtest: add src/content/github/common/animation.test.tstest: add src/content/github/common/utils.test.tstest: add src/content/github/common/fetchers.test.tstest: add src/content/github/common/constants.test.tstest: add src/content/common/sentry.test.tstest: add src/service.test.ts
How to run tests
Jestis included as a dev dependency.Run tests directly
./node_modules/.bin/jestOptional: add npm scripts
You can add convenient scripts to
package.json:{ "scripts": { "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage --coverageReporters=text-summary" } }Usage examples
Run tests once:
npm testRun tests in watch mode during development:
npm run test:watchRun tests with coverage summary:
npm run test:coverage
This contribution was created with assistance from ToTheos (https://totheos.com) to support test generation, code refactoring, and pull request preparation for an open-source codebases.
The tool was used to automate routine software development tasks.