{"id":19566012,"url":"https://github.com/simotae14/js-mocking-fundamentals","last_synced_at":"2026-06-15T11:31:09.173Z","repository":{"id":44022330,"uuid":"229955873","full_name":"simotae14/js-mocking-fundamentals","owner":"simotae14","description":"javascript mocking monkey-patching solution","archived":false,"fork":false,"pushed_at":"2022-12-10T13:02:34.000Z","size":874,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-26T09:32:48.287Z","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/simotae14.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":"2019-12-24T14:29:51.000Z","updated_at":"2023-03-08T20:44:21.000Z","dependencies_parsed_at":"2023-01-26T07:30:54.921Z","dependency_job_id":null,"html_url":"https://github.com/simotae14/js-mocking-fundamentals","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simotae14/js-mocking-fundamentals","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simotae14%2Fjs-mocking-fundamentals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simotae14%2Fjs-mocking-fundamentals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simotae14%2Fjs-mocking-fundamentals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simotae14%2Fjs-mocking-fundamentals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simotae14","download_url":"https://codeload.github.com/simotae14/js-mocking-fundamentals/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simotae14%2Fjs-mocking-fundamentals/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34358690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"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":[],"created_at":"2024-11-11T05:29:23.215Z","updated_at":"2026-06-15T11:31:09.155Z","avatar_url":"https://github.com/simotae14.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  JavaScript Mocking Fundamentals\n\u003c/h1\u003e\n\n\u003cp align=\"center\" style=\"font-size: 1.2rem;\"\u003e\n  Learn how mocking in JavaScript tests works by implementing them from scratch!\n\u003c/p\u003e\n\n\u003chr /\u003e\n\nIn this material, we have a set of `no-framework` tests that correspond to a set\nof jest tests (in the `__tests__` directory). The idea is that (with the\nexception of the first test), you look at the jest version first, then see how\nthat would be implemented without a testing framework.\n\nOrder of material:\n\n1.  `monkey-patching.js` (no jest version)\n2.  `mock-fn.js`\n3.  `spy.js`\n4.  `inline-module-mock.js`\n5.  `external-mock-module.js`\n\nThe files are intended to test the `thumb-war.js` module and mock the `utils`\nmodule.\n\nTo run the tests, run `npx jest`. To start watch mode run `npx jest --watch`\n\n## Custom jest runner.\n\nYou can definitely run the `no-framework` files just using `node` (like this:\n`node src/no-framework/monkey-patching.js`), but in an effort to make running\nthese easier, I created a custom jest runner that uses jest to run the files,\nbut allow them to be run without the jest testing framework. It's really cool.\nIt uses [`create-jest-runner`](https://www.npmjs.com/package/create-jest-runner)\nand should probably be published eventually.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimotae14%2Fjs-mocking-fundamentals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimotae14%2Fjs-mocking-fundamentals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimotae14%2Fjs-mocking-fundamentals/lists"}