{"id":15537492,"url":"https://github.com/nullvoxpopuli/ember-test-helpers-extra","last_synced_at":"2026-01-20T02:01:26.687Z","repository":{"id":66344718,"uuid":"199215194","full_name":"NullVoxPopuli/ember-test-helpers-extra","owner":"NullVoxPopuli","description":"Additional test helpers that build upon the primitives in @ember/test-helpers","archived":false,"fork":false,"pushed_at":"2019-07-28T15:28:23.000Z","size":19,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T20:48:15.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/NullVoxPopuli.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":"2019-07-27T21:31:02.000Z","updated_at":"2020-01-16T17:39:45.000Z","dependencies_parsed_at":"2023-02-21T23:45:27.400Z","dependency_job_id":null,"html_url":"https://github.com/NullVoxPopuli/ember-test-helpers-extra","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NullVoxPopuli/ember-test-helpers-extra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fember-test-helpers-extra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fember-test-helpers-extra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fember-test-helpers-extra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fember-test-helpers-extra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NullVoxPopuli","download_url":"https://codeload.github.com/NullVoxPopuli/ember-test-helpers-extra/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fember-test-helpers-extra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28593776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T01:57:22.592Z","status":"online","status_checked_at":"2026-01-20T02:00:07.325Z","response_time":117,"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-10-02T11:57:43.167Z","updated_at":"2026-01-20T02:01:26.668Z","avatar_url":"https://github.com/NullVoxPopuli.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ember-test-helpers-extra\n\n## Install\n\n```\nyarn add --dev ember-test-helpers-extra\n```\n\n## Usage\n\n### `getService`\n\nRetreives a service by name.\n\n```ts\nlet store = getService('store');\n```\n\n### `stubService`\n\nStubs a service by name, using either an object or Service class definition\n\n```ts\nstubService('my-service', {\n  foo() {\n    return false;\n  }\n});\n```\n\n```ts\nstubService('my-service', Service.extend({\n  foo() {\n    return false;\n  }\n}));\n```\n\n### `setupServiceStub`\n\nThis helper is for a special situation in which you need to\nstub a service that has already been registered and accessed,\nwhich prevents you from re-registering a service stub.\n\nThis stems from (instance) initializers accessing the services.\nGenerally, it's best practice to avoid initializers -- but sometimes\nlegacy code has utilized their ability to reduce repetition,\nor run some boot-time code.\n\nRelated issue reported in ember-cli-qunit: https://github.com/ember-cli/ember-cli-qunit/issues/203#issuecomment-366261794\n\n```ts\nmodule('Integration | Component | my-component', function(hooks) {\n  setupRenderingTest(hooks);\n  setupServiceStub(hooks, 'my-service', {\n    foo() {\n      false;\n    }\n  })\n});\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullvoxpopuli%2Fember-test-helpers-extra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullvoxpopuli%2Fember-test-helpers-extra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullvoxpopuli%2Fember-test-helpers-extra/lists"}