{"id":19482106,"url":"https://github.com/andrewrunner/tdd-jest-practice","last_synced_at":"2026-04-12T07:38:32.563Z","repository":{"id":210427149,"uuid":"726533338","full_name":"andrewrunner/tdd-jest-practice","owner":"andrewrunner","description":"My experiments with jest test library (use pure http server on node.js)","archived":false,"fork":false,"pushed_at":"2024-02-05T10:22:39.000Z","size":262,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T11:52:57.903Z","etag":null,"topics":["jest","nodejs","tdd","typescript"],"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/andrewrunner.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-12-02T16:58:03.000Z","updated_at":"2024-10-30T15:46:33.000Z","dependencies_parsed_at":"2023-12-02T18:24:40.054Z","dependency_job_id":"3fb63330-7132-4119-a94f-c12e6c12c7fc","html_url":"https://github.com/andrewrunner/tdd-jest-practice","commit_stats":null,"previous_names":["andrewrunner/ex-jest-first-steps","andrewrunner/tdd-jest-practice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andrewrunner/tdd-jest-practice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrunner%2Ftdd-jest-practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrunner%2Ftdd-jest-practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrunner%2Ftdd-jest-practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrunner%2Ftdd-jest-practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewrunner","download_url":"https://codeload.github.com/andrewrunner/tdd-jest-practice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrunner%2Ftdd-jest-practice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31707953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"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":["jest","nodejs","tdd","typescript"],"created_at":"2024-11-10T20:08:28.341Z","updated_at":"2026-04-12T07:38:32.540Z","avatar_url":"https://github.com/andrewrunner.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ex-jest-first-steps\n\nMy experiments with Jest test library\n\n1. AAA principles (ARRANGE-ACT-ASSERT)\n2. F.I.R.S.T. principles (Fast, Independent, Repitable, Self-validating, Thorough) \n\n\nUse \n- VSCode \"REST Client\" extension for run  .http files \n- https://github.com/microsoft/vscode-recipes/tree/main/debugging-jest-tests\n\n\n\nJest hooks can help init common mocks for all tests;\n\nPrinciples:\n- One class = one test case.\n- One method = one or more tests.\n- One alternative branch (if/switch/try-catch/exception) = one test.\n\nDoubles:\n- Dummy object\n- Fakes\n- Stubs\n- Spiec\n- Mocks \n\n\nHeavy mock testing approach\nAdvantages:\n- Test classes in isolation\n- Impose a strict coding style  (If class has too many dependencies - it makes it hard to test...)\n- Once tests are in place, it easy to create new tests \nDisadvantages:\n- Test and implementation are tighly coupled (small change leads to many changes)\n- Hard to write \n\n\n\nMike Cohn's pyramid tests consist of three levels (from bottom to top):\n- Unit tests.\n- Service tests.\n- User interface tests.\nIn this pyramid, the main rule consists of two principles:\n\nThe higher the level, the fewer tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewrunner%2Ftdd-jest-practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewrunner%2Ftdd-jest-practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewrunner%2Ftdd-jest-practice/lists"}