{"id":23491493,"url":"https://github.com/sarwar-asik/testing-app","last_synced_at":"2025-07-30T06:08:21.896Z","repository":{"id":205957935,"uuid":"715497044","full_name":"sarwar-asik/testing-app","owner":"sarwar-asik","description":"Testing with vitest for unit_testing, dom_testing , React testing.","archived":false,"fork":false,"pushed_at":"2023-11-18T18:39:25.000Z","size":11980,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T01:46:03.598Z","etag":null,"topics":["dom-testing","react-testing","testing-library","unit-testing","vitest"],"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/sarwar-asik.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":"2023-11-07T09:08:02.000Z","updated_at":"2023-11-17T20:44:28.000Z","dependencies_parsed_at":"2025-02-16T12:34:23.766Z","dependency_job_id":null,"html_url":"https://github.com/sarwar-asik/testing-app","commit_stats":null,"previous_names":["sarwar-asik/unit-testing","sarwar-asik/testing-titans"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sarwar-asik/testing-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Ftesting-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Ftesting-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Ftesting-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Ftesting-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarwar-asik","download_url":"https://codeload.github.com/sarwar-asik/testing-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Ftesting-app/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267820860,"owners_count":24149291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dom-testing","react-testing","testing-library","unit-testing","vitest"],"created_at":"2024-12-25T01:28:03.756Z","updated_at":"2025-07-30T06:08:21.873Z","avatar_url":"https://github.com/sarwar-asik.png","language":"JavaScript","readme":"# unit-testing\n\n- dom testing\n- react app testing\n\n#### Created another testing with separate branch **dom-test \u0026 react-testing **\n\n- https://github.com/sarwar-asik/testing-titans/tree/dom-test\n- https://github.com/sarwar-asik/testing-titans/tree/react-testing\n\n# Overview of Testing with Vitest\n\n## 1. Unit Testing\n\n### Definition:\n\nUnit testing is a software testing technique where individual units or components of a software are tested in isolation to ensure they perform as expected.\n\n### Key Points:\n\n- Focuses on testing the smallest parts of a software application.\n- Tests are written for functions, methods, or modules.\n- Aims to validate that each unit of code works correctly in isolation.\n\n## 2. DOM Testing\n\n### Definition:\n\nDOM (Document Object Model) testing is a type of testing that involves validating the behavior and interactions of the HTML document structure.\n\n### Key Points:\n\n- Verifies how the application interacts with the DOM.\n- Ensures proper rendering of UI components.\n- Tests events, changes in state, and dynamic updates to the DOM.\n\n## 3. React App Testing\n\n### Definition:\n\nReact app testing involves testing React components, ensuring they render correctly, handle state and props properly, and respond to user interactions as expected.\n\n### Key Points:\n\n- Utilizes tools like Vitest for testing React applications.\n- Involves unit testing of individual React components.\n- Tests React component lifecycle methods, state changes, and UI rendering.\n\n## Vitest Testing Framework\n\n### Overview:\n\nVitest is a lightweight testing framework for JavaScript applications. It supports unit testing, provides a simple syntax, and is suitable for testing various aspects of web applications.\n\n### Key Features:\n\n- Minimal setup and configuration.\n- Built-in support for testing in a browser environment.\n- Designed for simplicity and ease of use.\n\n## Example Usage:\n- js function 'clnNumber.js'\n\n```javascript\n// Sample  js function\nimport { transformToNum } from \"../transformNum\";\n\nexport function validateNumber(value) {\n  return +value;\n}\n\nexport function cleanNumbers(values) {\n  const numbers = [];\n  for (const value of values) {\n    validateNumber(value);\n    const number = transformToNum(value);\n    numbers.push(number);\n  }\n  return numbers;\n}\n```\n- testing file in in 'clnNumber.test.js'\n\n```js\nimport { expect, it } from \"vitest\";\nimport { cleanNumbers } from \"./numberCheck\";\n// Sample Vitest testing file\nit(\"array of number provided\", () =\u003e {\n  const stringNumber = [\"2\", \"3\"];\n  const result = cleanNumbers(stringNumber);\n  expect(result[0]).toBeTypeOf(\"number\");\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarwar-asik%2Ftesting-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarwar-asik%2Ftesting-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarwar-asik%2Ftesting-app/lists"}