{"id":15476620,"url":"https://github.com/mahammad-mostafa/unit-testing-exercise","last_synced_at":"2025-07-31T18:02:39.962Z","repository":{"id":182693818,"uuid":"668920543","full_name":"mahammad-mostafa/unit-testing-exercise","owner":"mahammad-mostafa","description":"This is the fifth project in the second module in the Microverse program. It is an exercise for practicing unit testing in JavaScript using Jest framework \u0026 Test Driven Development.","archived":false,"fork":false,"pushed_at":"2023-07-21T16:32:02.000Z","size":113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T13:51:20.251Z","etag":null,"topics":["arrange-act-assert","arrow-functions","es6","javascript","jest","jest-matchers","npm-scripts","tdd-javascript","test-automation","test-driven-development","testing","testing-framework","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mahammad-mostafa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-07-20T23:18:24.000Z","updated_at":"2023-07-21T01:17:22.000Z","dependencies_parsed_at":"2024-10-02T03:40:36.967Z","dependency_job_id":null,"html_url":"https://github.com/mahammad-mostafa/unit-testing-exercise","commit_stats":null,"previous_names":["mahammad-mostafa/unit-testing-exercise"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahammad-mostafa%2Funit-testing-exercise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahammad-mostafa%2Funit-testing-exercise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahammad-mostafa%2Funit-testing-exercise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahammad-mostafa%2Funit-testing-exercise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mahammad-mostafa","download_url":"https://codeload.github.com/mahammad-mostafa/unit-testing-exercise/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246036519,"owners_count":20713252,"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":["arrange-act-assert","arrow-functions","es6","javascript","jest","jest-matchers","npm-scripts","tdd-javascript","test-automation","test-driven-development","testing","testing-framework","testing-tools"],"created_at":"2024-10-02T03:40:33.810Z","updated_at":"2025-03-28T13:27:49.364Z","avatar_url":"https://github.com/mahammad-mostafa.png","language":"JavaScript","readme":"\u003ca name=\"title\"\u003e\u003c/a\u003e\n\n\u003c!-- TITLE --\u003e\n\n# 🏷️ Unit Testing Exercise\n\nThis is the fifth project in the second module in the **Microverse** program.\n\u003cbr/\u003e\nCheck the below contents for further details about this project.\n\n\u003c!-- CONTENTS --\u003e\n\n# 📗 Contents\n\n- [Description](#description)\n- [Instructions](#instructions)\n- [Authors](#authors)\n- [Contributions](#contributions)\n- [Support](#support)\n- [Acknowledgements](#acknowledgements)\n- [License](#license)\n\n\u003c!-- DESCRIPTION --\u003e\n\n\u003ca name=\"description\"\u003e\u003c/a\u003e\n\n# 📖 Description\n\nThis project is an exercise for practicing unit testing using `Jest` framework with `TDD` (Test Driven Development).\nIt contains two directories `units` for functions \u0026 `testers` for testing functions.\nIt also includes config linters for `JavaScript` in the `.github` directory. \n\n📌 **Tech Stack:**\n- Logic \u0026 functionality built with `JavaScript`\n- Unit testing done with `Jest` framework\n\n📌 **Key Features:**\n- Each task has its own unit \u0026 tester file\n- All tasks are in separate test group with description text\n- Function `stringLength` returns a number for the input string length\n- Any string length outside the range of `(1 - 10)` throws an error `Value out of range!`\n- Three test cases are implemented in `stringLength.test.js` for checking valid \u0026 invalid input\n- Function `reverseString` returns the input string with characters in reverse order\n- One test case was done for `reverseString` function in `reverseString.test.js`\n- Object `calculator` contains four functions (`add` / `subtract` / `multiply` / `divide`)\n- Each function inside the `calculator` object has three test cases grouped together\n- Function `capitalize` takes a string input \u0026 returns it with first letter capitalized \n- The test cases for `capitalize` function was created first in `capitalize.test.js`\n- Any number input for `capitalize` function thriws an error `Invalid string!`\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#title\"\u003eback to top\u003c/a\u003e\u003c/p\u003e\n\n\u003c!-- INSTRUCTIONS --\u003e\n\n\u003ca name=\"instructions\"\u003e\u003c/a\u003e\n\n# 🛠️ Instructions\n\nYou can easily clone or fork this repository and work on it immadiately!\n\n📌 **Prerequisites:**\n- `NodeJS` for installing \u0026 running all packages\n- `Jest` testing framework installed with:\n```\nnpm i -D jest\n```\n\n📌 **Setup:**\n- Install all dependencies with `npm`\n- For running tests use:\n```\nnpm run test\n```\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#title\"\u003eback to top\u003c/a\u003e\u003c/p\u003e\n\n\u003c!-- AUTHORS --\u003e\n\n\u003ca name=\"authors\"\u003e\u003c/a\u003e\n\n# 👥 Authors\n\n📌 **Mahammad:**\n- [GitHub](https://github.com/mahammad-mostafa)\n- [Twitter](https://twitter.com/mahammad_mostfa)\n- [LinkedIn](https://linkedin.com/in/mahammad-mostafa)\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#title\"\u003eback to top\u003c/a\u003e\u003c/p\u003e\n\n\u003c!-- CONTRIBUTIONS --\u003e\n\n\u003ca name=\"contributions\"\u003e\u003c/a\u003e\n\n# 🤝🏻 Contributions\n\nWish to contribute to this project?\n\u003cbr/\u003e\nContributions, issues, and feature requests are more than welcome!\n\u003cbr/\u003e\nFeel free to check the [issues](../../issues) page too.\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#title\"\u003eback to top\u003c/a\u003e\u003c/p\u003e\n\n\u003c!-- SUPPORT --\u003e\n\n\u003ca name=\"support\"\u003e\u003c/a\u003e\n\n# ⭐️ Support\n\nLike this project? Show your support by starring!\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#title\"\u003eback to top\u003c/a\u003e\u003c/p\u003e\n\n\u003c!-- ACKNOWLEDGEMENTS --\u003e\n\n\u003ca name=\"acknowledgements\"\u003e\u003c/a\u003e\n\n# 🙏🏻 Acknowledgements\n\nI thank everyone at **Microverse** for guiding me through this project.\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#title\"\u003eback to top\u003c/a\u003e\u003c/p\u003e\n\n\u003c!-- LICENSE --\u003e\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n\n# 📝 License\n\nThis project is [MIT](LICENSE.md) licensed.\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#title\"\u003eback to top\u003c/a\u003e\u003c/p\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahammad-mostafa%2Funit-testing-exercise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahammad-mostafa%2Funit-testing-exercise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahammad-mostafa%2Funit-testing-exercise/lists"}