{"id":23403420,"url":"https://github.com/selmasaltik/testing-react-apps","last_synced_at":"2026-04-16T19:11:44.453Z","repository":{"id":266765826,"uuid":"899298104","full_name":"selmasaltik/testing-react-apps","owner":"selmasaltik","description":"Testing React Apps /// What I learned from \"React - The Complete Guide 2024 (incl. Next.js, Redux) - Academind by Maximilian Schwarzmüller\"","archived":false,"fork":false,"pushed_at":"2024-12-10T00:30:34.000Z","size":182,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T17:54:59.005Z","etag":null,"topics":["jest","react","react-testing-library","test","testing","unit-test"],"latest_commit_sha":null,"homepage":"https://testing-react-apps-three.vercel.app","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/selmasaltik.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":"2024-12-06T01:38:49.000Z","updated_at":"2024-12-10T00:31:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"aab88abf-34c9-439a-9f17-6119bb2f27e9","html_url":"https://github.com/selmasaltik/testing-react-apps","commit_stats":null,"previous_names":["selmasaltik/testing-react-apps"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selmasaltik%2Ftesting-react-apps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selmasaltik%2Ftesting-react-apps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selmasaltik%2Ftesting-react-apps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selmasaltik%2Ftesting-react-apps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selmasaltik","download_url":"https://codeload.github.com/selmasaltik/testing-react-apps/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247941705,"owners_count":21022035,"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","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":["jest","react","react-testing-library","test","testing","unit-test"],"created_at":"2024-12-22T12:47:50.332Z","updated_at":"2025-11-07T07:04:49.940Z","avatar_url":"https://github.com/selmasaltik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Testing React Apps\n***Automated Testing***\n\n- What is “Testing”? and Why?\n- Understanding Unit Tests\n- Testing React Components \u0026 Building Blocks\n\n**What is “Testing”?**\n\n- **Manual Testing**\n\nWrite Code → Preview \u0026 Test in Browser → Improve Code → Repeat\n\nVery important: You see what your users will see\n\n***Error-prone:*** It’s hard to always test all possible combinations \u0026 scenarios\n\n- **Automated Testing**\n\nWrite code that automatically tests your code\n\nYou test the individual building blocks of your app\n\nRequires extra knowledge (→ how to write tests) but allows you to test all building blocks of your app\n\n**Different Kinds Of Automated Tests**\n\n- **Unit Tests**\n\nTest the ***individual*** ***building blocks*** (functions, components) in ***isolation***\n\nProjects typically contain dozens or hundreds of unit tests\n\n***The most common / important kind of test***\n\n- **Integration Tests**\n\nTest the ***combination*** of multiple building blocks\n\nProjects typically contain  couple of integration tests\n\n***Also important, but focus on unit tests in most cases***\n\n- **End-to-End (E2E) Tests**\n\nTest complete scenarios \u0026 user flows in your app (as the user would experience them)\n\nProjects typically contain only a few E2E tests\n\n***Important but can also be done manually (partially)***\n\n**What Should You Test?**\n\n**What?**\n\nTest the different app building blocks\n\n***Unit test:*** The smallest building blocks that make up your app\n\n**+**\n\n**How?**\n\nTest success and error cases, also test rare (but possible) results\n\n**Required Tools \u0026 Setup**\n\nWe need a tool or running our tests and asserting the results → ***Jest***\n\n[Jest](https://jestjs.io/)\n\n**+**\n\nWe need a tool for “simulating” (rendering) our React app / components **→** ***React Testing Library***\n\n[React Testing Library | Testing Library](https://testing-library.com/docs/react-testing-library/intro/)\n\nBoth tools are already set up for you when using create-react-app\n\n**Writing Tests — The Three “A”s**\n\n***Arrange***: Set up the test data, test conditions and test environment\n\n***Act***: Run logic that should be tested (e.g., execute function)\n\n***Assert***: Compare execution results with expected results\n\n[ARIA in HTML](https://www.w3.org/TR/html-aria/#docconformance)\n\nhttps://github.com/testing-library/react-hooks-testing-library\n\n[Introduction | React Hooks Testing Library](https://react-hooks-testing-library.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselmasaltik%2Ftesting-react-apps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselmasaltik%2Ftesting-react-apps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselmasaltik%2Ftesting-react-apps/lists"}