{"id":15598429,"url":"https://github.com/fluffynuts/string-calculator-kata","last_synced_at":"2026-05-16T00:08:39.080Z","repository":{"id":40515794,"uuid":"149730287","full_name":"fluffynuts/string-calculator-kata","owner":"fluffynuts","description":"A starting point for the String Calculator Kata, in Javascript, using Jest","archived":false,"fork":false,"pushed_at":"2022-05-04T06:16:07.000Z","size":879,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T16:50:58.619Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluffynuts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-21T07:59:08.000Z","updated_at":"2022-05-04T06:16:11.000Z","dependencies_parsed_at":"2022-07-26T06:16:11.106Z","dependency_job_id":null,"html_url":"https://github.com/fluffynuts/string-calculator-kata","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2Fstring-calculator-kata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2Fstring-calculator-kata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2Fstring-calculator-kata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2Fstring-calculator-kata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluffynuts","download_url":"https://codeload.github.com/fluffynuts/string-calculator-kata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240466793,"owners_count":19805862,"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":[],"created_at":"2024-10-03T01:39:43.213Z","updated_at":"2026-05-16T00:08:39.043Z","avatar_url":"https://github.com/fluffynuts.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# String Calculator Kata\n\n\u003cdetails\u003e\u003csummary\u003e\u003cstrong\u003eHow to use this starter\u003c/strong\u003e\u003c/summary\u003e\n- ensure you have NodeJS installed (via installer, package or nvm -- should be at least version 8)\n- clone this somewhere (fork first if you want to, of course)\n- I suggest using Visual Studio Code. If you are using VSCode, open the folder where you've put this starting-point, and press Ctrl-~ to open the inbuilt terminal for running the following commands. If you're using another environment, I suggest using an inbuilt terminal if available (eg in WebStorm), otherwise, open a terminal, cd to where this code lives and run:\n    - `npm install`\n    - `npm run autotest`\n- If you're using VSCode, I suggest opening this README.md and pressing Ctrl+Shift+V (default keybinding on windows) to open this document in Markdown preview. If that keybinding doesn't work, try opening the command pallete (Ctrl+Shift+P on windows \u0026 linux, Cmd+Shift+P on mac) and typing \"Markdown\", then selecting \"Markdown: Open Preview\".\n\u003c/details\u003e\n\n#### Before you start:\n\n- Try not to read ahead\n- Do one task at a time. The trick is to learn to work incrementally. Solve each requirement with the simplest code. Scenarios outside of the specified requirements are not supported and any error which arises from them is _perfectly fine_\n- _Make sure you only test for correct inputs. there is no need to test for invalid inputs for this kata. This is part of the design of the kata: implement **only** what is necessary_\n- **NB**: When implementing new features, it's important to remember that\nexisting features _should continue to work as specified_.\n\n\u003cdetails\u003e\u003csummary\u003eInitial spec\u003c/summary\u003e\n\n    Create a simple String calculator class with a method named Add which takes in a string and returns an integer.\n\n    The method can take 0, 1 or 2 numbers, and will return their sum (for an empty string it will return 0)\n        for example “” or “1” or “1,2”\n\n    Start with the simplest test case of an empty string and move   to 1 and two numbers\n\n    Remember to solve things as simply as possible so that you force yourself to write tests you did not think about\n\n    Remember the TDD cadence:\n        RED\n        GREEN\n        REFACTOR\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eNew feature: more inputs\u003c/summary\u003e\n\n    Allow the Add method to handle an unknown amount of numbers\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eNew feature: more delimiters\u003c/summary\u003e\n\n    Allow the Add method to handle new lines between numbers (instead of commas).\n\n    Example of supported syntax:\n        “1\\n2,3”  (will equal 6)\n\n    Example of unsupported syntax:\n        “1,\\n” (clarification: no need to test around this)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eNew feature: support any single-char delimiter\u003c/summary\u003e\n\n    To set the delimiter, the beginning of the string will contain a separate line that looks like this:   “//[delimiter]\\n[numbers…]”\n\n    For example: given “//;\\n1;2” should return 3\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eNew feature: handle negative numbers\u003c/summary\u003e\n\n    Calling Add with a negative number should throw an exception\n\n    The error should have a message starting with “negatives not allowed”\n\n    The error should contain the negative number that was passed in\n\n    If there are multiple negatives, show all of them in the exception message.\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eNew feature: handle large numbers\u003c/summary\u003e\n\n    Numbers bigger than 1000 should be ignored\n\n    For example, attempting to add  2 + 1001 should return 2\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eNew feature: multi-length delimiters\u003c/summary\u003e\n\n    Delimiters can be of any length with the following format:\n    “//[delimiter]\\n”\n\n    For example: “//[***]\\n1***2***3” should return 6\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eNew feature: multiple delimiters\u003c/summary\u003e\n\n    Allow multiple delimiters like this:  “//[delim1][delim2]\\n”\n\n    For example “//[*][%]\\n1*2%3” should return 6.\n\u003c/details\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluffynuts%2Fstring-calculator-kata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluffynuts%2Fstring-calculator-kata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluffynuts%2Fstring-calculator-kata/lists"}