{"id":23623274,"url":"https://github.com/bahmutov/tdd-calc","last_synced_at":"2025-09-26T12:31:16.446Z","repository":{"id":260139244,"uuid":"878956523","full_name":"bahmutov/tdd-calc","owner":"bahmutov","description":"Build a simple HTML calculator using test-driven development","archived":false,"fork":false,"pushed_at":"2024-11-23T21:52:04.000Z","size":734,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T20:33:57.449Z","etag":null,"topics":["cypress-example"],"latest_commit_sha":null,"homepage":"https://cypress.tips/courses/tdd-calculator","language":null,"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/bahmutov.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-10-26T15:16:48.000Z","updated_at":"2024-11-24T20:47:33.000Z","dependencies_parsed_at":"2024-11-15T16:38:30.782Z","dependency_job_id":null,"html_url":"https://github.com/bahmutov/tdd-calc","commit_stats":null,"previous_names":["bahmutov/tdd-calc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftdd-calc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftdd-calc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftdd-calc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftdd-calc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahmutov","download_url":"https://codeload.github.com/bahmutov/tdd-calc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234309714,"owners_count":18811949,"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":["cypress-example"],"created_at":"2024-12-27T20:34:11.813Z","updated_at":"2025-09-26T12:31:16.077Z","avatar_url":"https://github.com/bahmutov.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# tdd-calc\n\n\u003e Build a simple HTML calculator using test-driven development\n\n🎓 This is the example application for the course [TDD Calculator](https://cypress.tips/courses/tdd-calculator).\n\n![Calculator test](./images/calc.png)\n\n## Lessons\n\nClone this repo to your local machine\n\n```shell\n$ git clone git@github.com:bahmutov/tdd-calc.git\n# git clones the repo into \"tdd-calc\" folder\n$ cd tdd-calc\n```\n\nThe starting code for each lesson is located in a separate branch, like `a1`, `a2`, ... etc. A typical lesson would start with:\n\n```\n$ git checkout \u003cbranch name\u003e\n$ npm install\n$ npx cypress open\n```\n\nThen follow the lesson prompts from [the course](https://cypress.tips/courses/tdd-calculator)\n\n## Branches\n\n| Branch | Lesson                                                                                                                       |\n| ------ | ---------------------------------------------------------------------------------------------------------------------------- |\n| `a1`   | [Lesson a1: Add HTML page](https://cypress.tips/courses/tdd-calculator/lessons/a1)                                           |\n| `a2`   | [Lesson a2: Add the main calculator elements](https://cypress.tips/courses/tdd-calculator/lessons/a2)                        |\n| `a3`   | [Lesson a3: Page resources](https://cypress.tips/courses/tdd-calculator/lessons/a3)                                          |\n| `a4`   | [Lesson a4: Add buttons](https://cypress.tips/courses/tdd-calculator/lessons/a4)                                             |\n| `a5`   | [Lesson a5: Enter numbers](https://cypress.tips/courses/tdd-calculator/lessons/a5)                                           |\n| `a6`   | [Lesson a6: Enter expressions](https://cypress.tips/courses/tdd-calculator/lessons/a6)                                       |\n| `b1`   | [Lesson b1: Re-run tests on application changes](https://cypress.tips/courses/tdd-calculator/lessons/b1)                     |\n| `b2`   | [Lesson b2: Clear the current expression](https://cypress.tips/courses/tdd-calculator/lessons/b2)                            |\n| `b3`   | [Lesson b3: Spy on global application functions](https://cypress.tips/courses/tdd-calculator/lessons/b3)                     |\n| `b4`   | [Lesson b4: Add a custom command](https://cypress.tips/courses/tdd-calculator/lessons/b4)                                    |\n| `b5`   | [Lesson b5: Decimal point happy paths](https://cypress.tips/courses/tdd-calculator/lessons/b5)                               |\n| `b6`   | [Lesson b6: Decimal edge cases](https://cypress.tips/courses/tdd-calculator/lessons/b6)                                      |\n| `b7`   | [Lesson b7: Unit tests](https://cypress.tips/courses/tdd-calculator/lessons/b7)                                              |\n| `c1`   | [Lesson c1: Calculate the expression](https://cypress.tips/courses/tdd-calculator/lessons/c1)                                |\n| `c2`   | [Lesson c2: Invalid expressions](https://cypress.tips/courses/tdd-calculator/lessons/c2)                                     |\n| `c3`   | [Lesson c3: Do not evaluate invalid expressions](https://cypress.tips/courses/tdd-calculator/lessons/c3)                     |\n| `c4`   | [Lesson c4: Style the display element](https://cypress.tips/courses/tdd-calculator/lessons/c4)                               |\n| `c5`   | [Lesson c5: Style the keyboard buttons](https://cypress.tips/courses/tdd-calculator/lessons/c5)                              |\n| `c6`   | [Lesson c6: Make the keyboard buttons round](https://cypress.tips/courses/tdd-calculator/lessons/c6)                         |\n| `c7`   | [Lesson c7: Style the body element](https://cypress.tips/courses/tdd-calculator/lessons/c7)                                  |\n| `c8`   | [Lesson c8: Style the operator buttons](https://cypress.tips/courses/tdd-calculator/lessons/c8)                              |\n| `c9`   | [Lesson c9: Style the hover state](https://cypress.tips/courses/tdd-calculator/lessons/c9)                                   |\n| `c10`  | [Lesson c10: Confirm the operator buttons hover styles](https://cypress.tips/courses/tdd-calculator/lessons/c10)             |\n| `d1`   | [Lesson d1: Error message goes away](https://cypress.tips/courses/tdd-calculator/lessons/d1)                                 |\n| `d2`   | [Lesson d2: Halloween pumpkins](https://cypress.tips/courses/tdd-calculator/lessons/d2)                                      |\n| `d3`   | [Lesson d3: The saved expression](https://cypress.tips/courses/tdd-calculator/lessons/d3)                                    |\n| `d4`   | [Lesson d4: Check an object stored in local storage](https://cypress.tips/courses/tdd-calculator/lessons/d4)                 |\n| `d5`   | [Lesson d5: Add the history element](https://cypress.tips/courses/tdd-calculator/lessons/d5)                                 |\n| `d6`   | [Lesson d6: Append history items](https://cypress.tips/courses/tdd-calculator/lessons/d6)                                    |\n| `d7`   | [Lesson d7: Use a page object](https://cypress.tips/courses/tdd-calculator/lessons/d7)                                       |\n| `d8`   | [Lesson d8: Store history in the local storage](https://cypress.tips/courses/tdd-calculator/lessons/d8)                      |\n| `d9`   | [Lesson d9: Restore history from local storage](https://cypress.tips/courses/tdd-calculator/lessons/d9)                      |\n| `d10`  | [Lesson d10: Implement data migration](https://cypress.tips/courses/tdd-calculator/lessons/d10)                              |\n| `d11`  | [Lesson d11: Find and fix a history edge case](https://cypress.tips/courses/tdd-calculator/lessons/d11)                      |\n| `e1`   | [Lesson e1: Run all tests on CI](https://cypress.tips/courses/tdd-calculator/lessons/e1)                                     |\n| `e2`   | [Lesson e2: Use ES6 JavaScript modules](https://cypress.tips/courses/tdd-calculator/lessons/e2)                              |\n| `e3`   | [Lesson e3: Unit tests for an exported function](https://cypress.tips/courses/tdd-calculator/lessons/e3)                     |\n| `e4`   | [Lesson e4: Run all specs](https://cypress.tips/courses/tdd-calculator/lessons/e4)                                           |\n| `e5`   | [Lesson e5: Print page as PDF](https://cypress.tips/courses/tdd-calculator/lessons/e5)                                       |\n| `e6`   | [Lesson e6: Catch accessibility issues](https://cypress.tips/courses/tdd-calculator/lessons/e6)                              |\n| `e7`   | [Lesson e7: Button color contrast](https://cypress.tips/courses/tdd-calculator/lessons/e7)                                   |\n| `f1`   | [Lesson f1: Remove the global calculate function](https://cypress.tips/courses/tdd-calculator/lessons/f1)                    |\n| `f2`   | [Lesson f2: Remove the global clear display function](https://cypress.tips/courses/tdd-calculator/lessons/f2)                |\n| `f3`   | [Lesson f3: Remove the global enterDigit function](https://cypress.tips/courses/tdd-calculator/lessons/f3)                   |\n| `f4`   | [Lesson f4: Use TypeScript for specs](https://cypress.tips/courses/tdd-calculator/lessons/f4)                                |\n| `f5`   | [Lesson f5: Fix TypeScript lint errors](https://cypress.tips/courses/tdd-calculator/lessons/f5)                              |\n| `f6`   | [Lesson f6: Code coverage](https://cypress.tips/courses/tdd-calculator/lessons/f6)                                           |\n| `f7`   | [Lesson f7: 100% code coverage](https://cypress.tips/courses/tdd-calculator/lessons/f7)                                      |\n| `g1`   | [Lesson g1: Add the copy history button](https://cypress.tips/courses/tdd-calculator/lessons/g1)                             |\n| `g2`   | [Lesson g2: Write text to the clipboard](https://cypress.tips/courses/tdd-calculator/lessons/g2)                             |\n| `g3`   | [Lesson g3: Testing the error code path](https://cypress.tips/courses/tdd-calculator/lessons/g3)                             |\n| `g4`   | [Lesson g4: Refactor the storage functions](https://cypress.tips/courses/tdd-calculator/lessons/g4)                          |\n| `g5`   | [Lesson g5: Test the serialization error](https://cypress.tips/courses/tdd-calculator/lessons/g5)                            |\n| `g6`   | [Lesson g6: Move load and save data functions into their own module](https://cypress.tips/courses/tdd-calculator/lessons/g6) |\n| `g7`   | [Lesson g7: Stub the entire source file](https://cypress.tips/courses/tdd-calculator/lessons/g7)                             |\n| `h1`   | [Lesson h1: Control the calculator language](https://cypress.tips/courses/tdd-calculator/lessons/h1)                         |\n| `h2`   | [Lesson h2: Change language using URL search parameter](https://cypress.tips/courses/tdd-calculator/lessons/h2)              |\n| `h3`   | [Lesson h3: Toggle language using a button](https://cypress.tips/courses/tdd-calculator/lessons/h3)                          |\n| `h4`   | [Lesson h4: Count page reloads](https://cypress.tips/courses/tdd-calculator/lessons/h4)                                      |\n\n## Small print\n\nCopyright 2024 ©️ Gleb Bahmutov\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Ftdd-calc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahmutov%2Ftdd-calc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Ftdd-calc/lists"}