{"id":27249760,"url":"https://github.com/leonsilva15/javascript-testing","last_synced_at":"2026-05-06T17:33:50.217Z","repository":{"id":245647196,"uuid":"815358435","full_name":"LeonSilva15/javascript-testing","owner":"LeonSilva15","description":"JavaScript unit testing using Vitest","archived":false,"fork":false,"pushed_at":"2024-07-28T09:42:08.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T10:40:21.735Z","etag":null,"topics":["aaa-testing","code-coverage","javascript","unit-testing","vite","vitest","vitest-ui"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/LeonSilva15.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,"zenodo":null}},"created_at":"2024-06-15T00:05:34.000Z","updated_at":"2024-07-28T09:42:11.000Z","dependencies_parsed_at":"2024-06-23T06:13:59.519Z","dependency_job_id":"58a3fcfd-8bc5-4903-a42e-b8809d673c6a","html_url":"https://github.com/LeonSilva15/javascript-testing","commit_stats":null,"previous_names":["leonsilva15/javascript-testing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LeonSilva15/javascript-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonSilva15%2Fjavascript-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonSilva15%2Fjavascript-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonSilva15%2Fjavascript-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonSilva15%2Fjavascript-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeonSilva15","download_url":"https://codeload.github.com/LeonSilva15/javascript-testing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonSilva15%2Fjavascript-testing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32704432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["aaa-testing","code-coverage","javascript","unit-testing","vite","vitest","vitest-ui"],"created_at":"2025-04-11T00:31:48.046Z","updated_at":"2026-05-06T17:33:50.201Z","avatar_url":"https://github.com/LeonSilva15.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript Testing\nTesting in software development is a crucial process aimed at ensuring the quality, functionality, and reliability of software applications. It involves executing software with the intent of identifying errors, gaps, or missing requirements compared to the desired outcomes. The process of software testing can be broadly categorized into several key types, each serving a specific purpose within the development lifecycle\n\n### You can also read:\n* [Vitest](./Vitest.md)\n* [Types of Testing](./Types%20of%20Testing.md)\n* [Best Practices](./Best%20Practices.md)\n\n## Initial setup\n1. Initialize your project\n    ```bash\n    npm init\n    ```\n2. Install Vitest as a development dependency\n    ```bash\n    npm i -D vitest\n    ```\n3. Add the test command to your package.json\n    ```text\n    scripts: {\n        ...\n        \"test\": \"vitest\"\n    }\n    ```\n4. Run your tests in watch mode\n    ```bash\n    npm run test\n    ```\n\n![1 - vitest running](https://github.com/LeonSilva15/javascript-testing/assets/36859776/a70c8404-cc68-4d07-bb7b-94cd8184fca8)\n![2 - vitest commands](https://github.com/LeonSilva15/javascript-testing/assets/36859776/9b2a5f74-7f57-4d1b-94a5-8ceab41b2e1c)\n\n## Test UI\n1. Install @vitest/ui\n    ```bash\n    npm i -D @vitest/ui\n    ```\n2. Add test:ui command to package.json\n    ```text\n    scripts: {\n        ...\n        \"test:ui\": \"vitest --ui\"\n    }\n    ```\n3. Run the test:ui command\n    ```bash\n    npm run test:ui\n    ```\n\n![3 - vitest ui](https://github.com/LeonSilva15/javascript-testing/assets/36859776/c281794a-e987-43a8-b922-cc9d3bfa6e2d)\n![4 - vitest ui 2](https://github.com/LeonSilva15/javascript-testing/assets/36859776/e7ad3a64-e596-41ff-b351-c87a9b7307a2)\n\n## Code Coverage\n1. Add the command to package.json\n    ```text\n    scripts: {\n        ...\n        \"coverage\": \"vitest run --coverage\"\n    }\n    ```\n2. Run the coverage command and install the dependencies\n    ```bash\n    npm run coverage\n    ```\n3. Re-run the command\n    ```bash\n    npm run coverage\n    ```\n4. Go to the generated `coverage` directory\n5. Open your `index.html` file (recommended extension - LiveServer)\n\n![5 - vitest coverage](https://github.com/LeonSilva15/javascript-testing/assets/36859776/673d06d6-4a44-4695-b30d-4f4193396ebb)\n![6 - vitest coverage 2](https://github.com/LeonSilva15/javascript-testing/assets/36859776/853282df-1312-48d2-8a12-417ccf8d0c33)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonsilva15%2Fjavascript-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleonsilva15%2Fjavascript-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonsilva15%2Fjavascript-testing/lists"}