{"id":19972478,"url":"https://github.com/traveltimn/testing-jest","last_synced_at":"2026-05-16T11:34:37.514Z","repository":{"id":98650771,"uuid":"384062516","full_name":"TravelTimN/testing-jest","owner":"TravelTimN","description":"Introduction to Jest testing from Code Institute 5P course","archived":false,"fork":false,"pushed_at":"2021-07-08T10:21:30.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-15T06:49:05.301Z","etag":null,"topics":["javascript","jest"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/TravelTimN.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":"2021-07-08T08:56:33.000Z","updated_at":"2022-02-05T12:05:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"2cf64a50-b279-47fc-962a-cc16bfb56c46","html_url":"https://github.com/TravelTimN/testing-jest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"Code-Institute-Org/gitpod-full-template","purl":"pkg:github/TravelTimN/testing-jest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TravelTimN%2Ftesting-jest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TravelTimN%2Ftesting-jest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TravelTimN%2Ftesting-jest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TravelTimN%2Ftesting-jest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TravelTimN","download_url":"https://codeload.github.com/TravelTimN/testing-jest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TravelTimN%2Ftesting-jest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231163,"owners_count":25245675,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["javascript","jest"],"created_at":"2024-11-13T03:08:20.190Z","updated_at":"2026-05-16T11:34:32.494Z","avatar_url":"https://github.com/TravelTimN.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Testing with [Jest](https://jestjs.io/)\n\n## Initialize NPM\n- `npm init`\n- hit `\u003center\u003e` for all options except for **test command:**, and type `jest`.\n\n## Use Jest in a dev environment\n- Adds Jest to a list called Dev Dependencies\n- `npm install --save-dev jest`\n\n## Run Jest\n- `npm test`\n\n## Describing Tests\n\u003cdetails\u003e\n\u003csummary\u003eSample Test in plain English\u003c/summary\u003e\n\n- I want to test a calculator.\n- I am going to test the addition function.\n- I want to get the result of 42.\n- I expect 20 + 22 to equal 42.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eSample Test using Jest\u003c/summary\u003e\n\n```javascript\ndescribe(\"calculator tests\", () =\u003e {\n    describe(\"addition tests\", () =\u003e {\n        test(\"should return 42\", () =\u003e {\n            expect(addition(20, 22)).toBe(42);\n        });\n    });\n});\n```\n\n- `.toBe()` is a type of \"Matcher\".\n- View [Jest Matchers](https://jestjs.io/docs/using-matchers).\n\n\u003c/details\u003e\n\n---\n\n## **IMPORTANT !**\n\n### Due to a change in Jest's default configuration, you need to add the following code to the top of your `button.test.js` file:\n\n```javascript\n/**\n * @jest-environment jsdom\n */\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraveltimn%2Ftesting-jest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraveltimn%2Ftesting-jest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraveltimn%2Ftesting-jest/lists"}