{"id":26556783,"url":"https://github.com/skrivle/mock-loader","last_synced_at":"2025-03-22T11:34:05.723Z","repository":{"id":57300061,"uuid":"46968543","full_name":"skrivle/mock-loader","owner":"skrivle","description":"Webpack mock loader","archived":false,"fork":false,"pushed_at":"2017-05-26T12:46:13.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T19:17:37.638Z","etag":null,"topics":["amd-modules","javascript","mock","webpack"],"latest_commit_sha":null,"homepage":"","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/skrivle.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":"2015-11-27T08:30:14.000Z","updated_at":"2023-03-10T10:53:14.000Z","dependencies_parsed_at":"2022-08-26T18:02:29.651Z","dependency_job_id":null,"html_url":"https://github.com/skrivle/mock-loader","commit_stats":null,"previous_names":["vejersele/mock-loader"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrivle%2Fmock-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrivle%2Fmock-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrivle%2Fmock-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrivle%2Fmock-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skrivle","download_url":"https://codeload.github.com/skrivle/mock-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244952242,"owners_count":20537463,"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":["amd-modules","javascript","mock","webpack"],"created_at":"2025-03-22T11:34:05.214Z","updated_at":"2025-03-22T11:34:05.720Z","avatar_url":"https://github.com/skrivle.png","language":"JavaScript","readme":"# Mock loader (WIP)\n\nWebpack mock loader for AMD modules only.\n\nInspired by [proxy-loader](https://github.com/c-dante/proxy-loader) and \n[inject-loader](https://github.com/plasticine/inject-loader) but since they \nboth lack descent support for AMD modules, this module was created.\n\n## Usage\n\nOnce a module is loaded with the mock loader an injector function will be \nreturned instead of the original module. This function can be used to mock the\noriginal dependencies of the loaded module. The injector accepts an object with \ndependency paths as keys and mock objects as values. If a given dependency is omitted\nthe original dependency will be loaded automatically.\n\n```javascript\ndefine(\n[\n    'mock!./myModule'\n],\nfunction (\n    myModuleInjector\n) {\n\n    var myMock = {\n        method: function () {\n            return true;\n        }\n    };\n\n    var myModule = myModuleInjector({\n        'path/to/original/dep': myMock\n    });\n});\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskrivle%2Fmock-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskrivle%2Fmock-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskrivle%2Fmock-loader/lists"}