{"id":24114784,"url":"https://github.com/sharonnavarro/angular-testing-jest","last_synced_at":"2026-04-07T20:31:34.616Z","repository":{"id":272853317,"uuid":"914989203","full_name":"SharonNavarro/angular-testing-jest","owner":"SharonNavarro","description":"Angular proyect with Jest as JavaScript testing framework","archived":false,"fork":false,"pushed_at":"2025-02-19T17:40:42.000Z","size":220,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T17:02:00.013Z","etag":null,"topics":["angular","jest","test","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SharonNavarro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-10T18:17:17.000Z","updated_at":"2025-02-19T17:40:46.000Z","dependencies_parsed_at":"2025-02-19T18:38:10.216Z","dependency_job_id":null,"html_url":"https://github.com/SharonNavarro/angular-testing-jest","commit_stats":null,"previous_names":["sharonnavarro/angular-testing-jest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SharonNavarro/angular-testing-jest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonNavarro%2Fangular-testing-jest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonNavarro%2Fangular-testing-jest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonNavarro%2Fangular-testing-jest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonNavarro%2Fangular-testing-jest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SharonNavarro","download_url":"https://codeload.github.com/SharonNavarro/angular-testing-jest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonNavarro%2Fangular-testing-jest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31528286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","jest","test","unit-testing"],"created_at":"2025-01-11T05:35:19.374Z","updated_at":"2026-04-07T20:31:34.595Z","avatar_url":"https://github.com/SharonNavarro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Angular Testing Course\n\nThis project demonstrates a comprehensive approach to testing Angular applications while improving code quality and maintaining consistent commit standards.\n\n## Overview\n\nThe **Angular Testing Jest** repository showcases for:\n- Unit testing for:\n    - Basic testings\n    - HTTP service\n    - Inputs/Outputs\n    - Basic routing\n- Integrating Jest as the primary testing framework.\n- Ensuring code quality through linting and formatting tools.\n- Enforcing commit message standards using Git hooks.\n\n---\n\n## Test report\n\nRun `npm run test:coverage`\n\n  ![image](https://github.com/user-attachments/assets/96c99e4f-93da-466f-937a-f49ac8187d4d)\n\n---\n\n## Features\n\n### 1. **Testing Framework: Jest**\n- Replaces the default Angular testing setup with [Jest](https://jestjs.io/), a faster and more flexible JavaScript testing framework.\n- Supports features like snapshot testing, powerful mocking, and easy integration with TypeScript.\n\n### 2. **Linting and Formatting**\n- Utilizes [ESLint](https://eslint.org/) for linting.\n- Integrates [Prettier](https://prettier.io/) to ensure consistent code formatting.\n- Adds custom ESLint plugins:\n  - **`eslint-plugin-simple-import-sort`**: Automatically sorts imports.\n  - **`eslint-plugin-unused-imports`**: Identifies and removes unused imports.\n\n### 3. **Commit Standards**\n- Enforces commit message conventions using [Commitlint](https://commitlint.js.org/).\n- Configured with the **Conventional Commits** standard via `@commitlint/config-conventional`.\n- Git hooks are managed with [Husky](https://typicode.github.io/husky/), ensuring linting, formatting, and commit validation before each push.\n\n---\n\n## Setup\n\n### Install Dependencies\n```bash\nnpm install\n```\n\n### Start Development Server\n```bash\nng serve\n```\n\n---\n\n## Scripts\n\n### Testing\n- **Run Unit Tests**:\n  ```bash\n  npm test\n  ```\n- **Run Tests in Watch Mode**:\n  ```bash\n  npm run test:watch\n  ```\n- **Run Tests in CI Mode**:\n  ```bash\n  npm run test:ci\n  ```\n\n### Code Quality\n- **Lint Code**:\n  ```bash\n  npm run lint\n  ```\n- **Format Code**:\n  ```bash\n  npm run format\n  ```\n\n### Husky and Commitlint\n- **Enable Husky**:\n  ```bash\n  npm run enabled-husky\n  ```\n- **Prepare Commit Hooks**:\n  ```bash\n  npm run prepare\n  ```\n\n---\n\n## Testing Libraries\n\n### 1. **Jest**:\n- Fast and efficient testing framework with an Angular preset for seamless integration.\n  - **Packages Installed**:\n    - `jest`\n    - `jest-preset-angular`\n    - `@types/jest`\n\n### 2. **Angular Testing Tools**:\n- Supports unit tests with Angular's testing modules and Karma for legacy compatibility.\n  - **Packages Installed**:\n    - `@angular-devkit/build-angular`\n    - `@angular/cli`\n    - \n---\n\n## Quality and Standards Tools\n\n### 1. **Linting and Formatting**\n- **ESLint**:\n  - Core linter for detecting issues in TypeScript and JavaScript files.\n  - Custom plugins:\n    - `eslint-config-prettier`: Prevents Prettier and ESLint from conflicting.\n    - `eslint-plugin-prettier`: Integrates Prettier rules into ESLint.\n    - `eslint-plugin-simple-import-sort`: Automatically organizes imports.\n    - `eslint-plugin-unused-imports`: Removes unused imports.\n- **Prettier**:\n  - Enforces a consistent code style across the project.\n\n### 2. **Commit Standards**\n- **Husky**:\n  - Configures Git hooks to run linting, formatting, and commit validation tasks.\n- **Commitlint**:\n  - Enforces [Conventional Commits](https://www.conventionalcommits.org/) to maintain clean and readable commit history.\n  - Configuration:\n    - `@commitlint/cli`\n    - `@commitlint/config-conventional`\n- **Lint-staged**:\n  - Runs linting and formatting checks only on staged files before commits.\n\n---\n\n## Resources\n\n- [Angular Testing Guide](https://angular.io/guide/testing)\n- [Jest Documentation](https://jestjs.io/docs/getting-started)\n- [ESLint Documentation](https://eslint.org/docs/latest/user-guide/getting-started)\n- [Prettier Documentation](https://prettier.io/docs/en/)\n- [Commitlint Documentation](https://commitlint.js.org/)\n- [Husky Documentation](https://typicode.github.io/husky/)\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharonnavarro%2Fangular-testing-jest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharonnavarro%2Fangular-testing-jest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharonnavarro%2Fangular-testing-jest/lists"}