{"id":19380876,"url":"https://github.com/rincedd/rewire-test-helper","last_synced_at":"2026-05-16T03:45:52.927Z","repository":{"id":65489901,"uuid":"62721637","full_name":"rincedd/rewire-test-helper","owner":"rincedd","description":null,"archived":false,"fork":false,"pushed_at":"2017-04-24T16:54:26.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T06:20:59.783Z","etag":null,"topics":["mocha","mocking","rewire","testing","testing-tools"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/rincedd.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}},"created_at":"2016-07-06T13:07:17.000Z","updated_at":"2017-07-24T11:31:17.000Z","dependencies_parsed_at":"2023-01-25T17:35:12.403Z","dependency_job_id":null,"html_url":"https://github.com/rincedd/rewire-test-helper","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rincedd%2Frewire-test-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rincedd%2Frewire-test-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rincedd%2Frewire-test-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rincedd%2Frewire-test-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rincedd","download_url":"https://codeload.github.com/rincedd/rewire-test-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240517244,"owners_count":19814163,"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":["mocha","mocking","rewire","testing","testing-tools"],"created_at":"2024-11-10T09:15:11.584Z","updated_at":"2026-05-16T03:45:52.902Z","avatar_url":"https://github.com/rincedd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rewire-test-helper\n[![Build Status](https://travis-ci.org/rincedd/rewire-test-helper.svg?branch=master)](https://travis-ci.org/rincedd/rewire-test-helper)\n\n---\n\n**DEPRECATED:** Prefer using `__rewire_reset_all__()` provided by `babel-plugin-rewire` \nsince version 1.1.0! This is safer and does not accumulate calls to global afterEach hooks.\n\n---\n\nSimplify working with `babel-plugin-rewire`. Automatically reset\nrewired dependencies in your testing framework's `afterEach` hook.\n\n## Usage\nUse with, e.g., `mocha`, `chai`, and `sinon`.\n```javascript\nimport {someMethod, __RewireAPI__} from './module-to-test';\nimport {rewire} from 'rewire-test-helper';\n\ndescribe('someMethod', function() {\n  const moduleToTest = rewire(__RewireAPI__);\n\n  it('should do something', function() {\n    const importedFunctionStub = sinon.stub();\n    moduleToTest.replace('anImportedFunction', importedFunctionStub);\n\n    someMethod();\n    expect(importedFunctionStub).to.have.been.called;\n  });\n});\n```\n\nAny imported dependency in `module-to-test` can be replaced by something\nelse using `replace`. By default, all imports will be reset after each test\nusing the `afterEach` hook of the test framework.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frincedd%2Frewire-test-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frincedd%2Frewire-test-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frincedd%2Frewire-test-helper/lists"}