{"id":16742010,"url":"https://github.com/cnunciato/ng-mock-component","last_synced_at":"2025-08-14T19:08:20.383Z","repository":{"id":142964151,"uuid":"77343971","full_name":"cnunciato/ng-mock-component","owner":"cnunciato","description":"An Angular module for mocking components.","archived":false,"fork":false,"pushed_at":"2019-08-15T02:14:00.000Z","size":8,"stargazers_count":53,"open_issues_count":5,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T01:11:08.535Z","etag":null,"topics":["angular","angular2","mocking-components"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/cnunciato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2016-12-25T21:44:51.000Z","updated_at":"2022-02-17T15:36:01.000Z","dependencies_parsed_at":"2023-06-26T01:23:50.007Z","dependency_job_id":null,"html_url":"https://github.com/cnunciato/ng-mock-component","commit_stats":{"total_commits":12,"total_committers":9,"mean_commits":"1.3333333333333333","dds":0.8333333333333334,"last_synced_commit":"e1cd888675831db11a26b0a13f3c752cf901006b"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cnunciato/ng-mock-component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnunciato%2Fng-mock-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnunciato%2Fng-mock-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnunciato%2Fng-mock-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnunciato%2Fng-mock-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cnunciato","download_url":"https://codeload.github.com/cnunciato/ng-mock-component/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnunciato%2Fng-mock-component/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270467672,"owners_count":24588807,"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-08-14T02:00:10.309Z","response_time":75,"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":["angular","angular2","mocking-components"],"created_at":"2024-10-13T01:07:01.275Z","updated_at":"2025-08-14T19:08:17.927Z","avatar_url":"https://github.com/cnunciato.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ng2-mock-component\n\nA very simple Angular 2 module for mocking components in unit tests.\n\n```\nnpm install --save-dev ng2-mock-component\n```\n\n## Usage\n\nJust specify the `selector` of the component you wish to mock (along with whatever other\n[metadata properties](https://angular.io/docs/ts/latest/api/core/index/Component-decorator.html)\nyou like), and `MockComponent` will supply that component with an empty template (unless you provide\na template string, in which case, it'll use that instead).\n\n```\nimport { TestBed } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { MyComponent } from './src/my.component';\nimport { MockComponent } from 'ng2-mock-component';\n\ndescribe('MyComponent', () =\u003e {\n  let fixture, element;\n\n  beforeEach(() =\u003e {\n    TestBed.configureTestingModule({\n      declarations: [\n        MyComponent,\n        MockComponent({ selector: 'my-subcomponent' })\n      ]\n    });\n\n    fixture = TestBed.createComponent(MyComponent);\n    element = fixture.debugElement;\n  });\n\n  it('works', () =\u003e {\n    fixture.detectChanges();\n    expect(element.query(By.css('my-subcomponent'))).not.toBeNull();\n  });\n});\n```\n\n## Author\n\nChristian Nunciato (chris@nunciato.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnunciato%2Fng-mock-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcnunciato%2Fng-mock-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnunciato%2Fng-mock-component/lists"}