{"id":25075037,"url":"https://github.com/dentednerd/jest-katas","last_synced_at":"2026-03-07T16:03:18.220Z","repository":{"id":40768393,"uuid":"263963512","full_name":"dentednerd/jest-katas","owner":"dentednerd","description":"Hands-on experience in writing tests with Jest.","archived":false,"fork":false,"pushed_at":"2023-01-06T05:54:38.000Z","size":1162,"stargazers_count":1,"open_issues_count":14,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T05:52:57.064Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dentednerd.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}},"created_at":"2020-05-14T16:10:38.000Z","updated_at":"2024-03-11T09:09:10.000Z","dependencies_parsed_at":"2023-02-05T11:30:54.896Z","dependency_job_id":null,"html_url":"https://github.com/dentednerd/jest-katas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dentednerd/jest-katas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dentednerd%2Fjest-katas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dentednerd%2Fjest-katas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dentednerd%2Fjest-katas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dentednerd%2Fjest-katas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dentednerd","download_url":"https://codeload.github.com/dentednerd/jest-katas/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dentednerd%2Fjest-katas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30221193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T14:02:48.375Z","status":"ssl_error","status_checked_at":"2026-03-07T14:02:43.192Z","response_time":53,"last_error":"SSL_read: 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":[],"created_at":"2025-02-07T00:29:51.787Z","updated_at":"2026-03-07T16:03:18.182Z","avatar_url":"https://github.com/dentednerd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jest Katas\n\nThese katas will give you some hands-on experience in writing tests in Jest. To run your tests, run `yarn test` in your terminal. To run a specific test in isolation, run `yarn test -t 'yourTestNameHere'`.\n\nUse [this list of Jest `expect` matchers](https://jestjs.io/docs/en/expect) to help you write your tests.\n\n## 1. TDD: fizzBuzz\n\nYour task is to write a function, `fizzBuzz`, that accepts a number and returns a string:\n\n- 'fizz' if the number is divisible by 3;\n- 'buzz' if the number is divisible by 5;\n- 'fizzbuzz' if the number is divisible by both 3 and 5.\n- '{number}' if the number doesn't fulfil any of the above conditions.\n\nAs you create the function in `fizzbuzz.js`, you should also write tests in `index.test.js`. You'll need to create your own test cases as you go.\n\nEdge cases to consider:\n\n- what should `fizzbuzz(0)` return?\n- what should happen if the function is passed a string?\n\n## 2. Mocking functions: mapWithCb\n\nThe `mapwithCb` function accepts an array and a callback. It maps over the array with the callback, so we can expect the callback function to be called multiple times.\n\nYour task is to write tests for `mapWithCb`, which will involve writing a mock function (aka a spy) for the callback function. The test cases have been provided for you.\n\n## 3. Mocking network responses with nock: getPokemon\n\nThe `getPokemon` function uses the `isomorphic-fetch` library to get data from [PokeAPI](https://pokeapi.co/). It returns a JSON object.\n\nYour task is to write tests for `getPokemon`, using the `nock` library to mock network responses. You'll need to create your own test cases.\n\nThings to consider:\n\n- What sort of data does PokeAPI return? Use the 'Try it now' section on the website to inform your mocked data.\n- Async functions don't throw errors in the same way as normal functions. `getPokemon()` and `getPokemon('cartman')` will behave differently.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdentednerd%2Fjest-katas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdentednerd%2Fjest-katas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdentednerd%2Fjest-katas/lists"}