{"id":15538759,"url":"https://github.com/scalvert/ember-sinon-sinoff","last_synced_at":"2026-05-18T04:37:52.381Z","repository":{"id":137291249,"uuid":"171054842","full_name":"scalvert/ember-sinon-sinoff","owner":"scalvert","description":"An Ember addon that automatically restores sinon after each test.","archived":false,"fork":false,"pushed_at":"2019-09-06T22:45:28.000Z","size":751,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-06T20:41:04.582Z","etag":null,"topics":["addon","ember","restore","sinon"],"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/scalvert.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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-02-16T21:39:50.000Z","updated_at":"2019-09-06T22:35:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"2afa1c2e-1bf5-42c9-95d6-e12d5778b63b","html_url":"https://github.com/scalvert/ember-sinon-sinoff","commit_stats":{"total_commits":217,"total_committers":10,"mean_commits":21.7,"dds":0.631336405529954,"last_synced_commit":"6c2675311fce5251e96417bb7ac0e570b8db2cd6"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/scalvert/ember-sinon-sinoff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalvert%2Fember-sinon-sinoff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalvert%2Fember-sinon-sinoff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalvert%2Fember-sinon-sinoff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalvert%2Fember-sinon-sinoff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalvert","download_url":"https://codeload.github.com/scalvert/ember-sinon-sinoff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalvert%2Fember-sinon-sinoff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275672840,"owners_count":25507467,"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-09-17T02:00:09.119Z","response_time":84,"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":["addon","ember","restore","sinon"],"created_at":"2024-10-02T12:06:15.454Z","updated_at":"2025-09-17T21:53:55.518Z","avatar_url":"https://github.com/scalvert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ember-sinon-sinoff\n\n| **This package has been deprecated**: Please use [ember-sinon-qunit](https://jhawk.co/ember-sinon-qunit). |\n| --- |\n\n[![Build Status](https://travis-ci.org/scalvert/ember-sinon-sinoff.svg?branch=master)](https://travis-ci.org/scalvert/ember-sinon-sinoff)\n[![npm version](https://badge.fury.io/js/ember-sinon-sinoff.svg)](https://badge.fury.io/js/ember-sinon-sinoff)\n\nThis addon adds automatic sandboxing of sinon to your QUnit tests. This ensures that sinon is correctly isolated and doesn't leak state between test executions.\n\n## Installation\n\nRun:\n\n```\nember install ember-sinon-sinoff\n```\n\n## Usage\n\nThe `ember-sinon-sinoff` addon supports two different API versions:\n\n1. The classic API, which automatically wires up sandbox creation and restoration to `QUnit.testStart` and `QUnit.testDone` respectively\n1. The new QUnit hooks API, which takes a `hooks` object and wires up sandbox creation and restoration to `beforeEach` and `afterEach` of the module.\n\n### Classic API\n\nTo use, import the setup method from within your `tests/test-helper.js` file and execute it.\n\n```js\nimport setupSinonSinoff from 'ember-sinon-sinoff/test-support/setup-global-sinon-sinoff';\n\n...\n\nsetupSinonSinoff();\n```\n\nThis will automatically wire-up the sandbox `sinon.sandbox.create` and `sandbox.restore` methods to QUnit `testStart` and `testDone` respectively.\n\n### QUnit `hooks` API\n\nTo use, import the setup method from within your test file and execute it.\n\n```js\nimport { setupSinonSinoff } from 'ember-sinon-sinoff/test-support';\n\n...\n\nmodule('my module', function(hooks) {\n  setupSinonSinoff(hooks);\n\n  test('my test', function(assert) {\n    ...\n  })\n})\n```\n\nThis will automatically wire-up the sandbox `sinon.createSandbox` and `sandbox.restore` methods to the module's `beforeEach` and `afterEach` respectively.\n\n### Accessing Sinon from Within Tests\n\nIn each test you will be able to access the same sandboxed version of sinon via the `this.sandbox` property available within the test's scope:\n\n```js\ntest('very important test happening here', function(assert) {\n  const spy = this.sandbox.spy();\n\n  ...\n});\n```\n\nBoth the global sinon object and the `this.sandbox` convenience property point to the same, test-specific instance of a sinon sandbox.\n\n### Incremental Migration\n\nTo ease the path to migrate to using `ember-sinon-sinoff`'s version of a fully sandboxed sinon, the sandbox that's provided includes a `create` method, which returns the same instance of the sandbox referenced by `this.sandbox`. This allows you to incrementally remove usages of sandboxing within your application.\n\n```js\ntest('another equally important test', function(assert) {\n  // sandbox === this.sandbox\n  const sandbox = sinon.sandbox.create();\n  ...\n});\n```\n\n## Contributing\n\n### Installation\n\n- `git clone git@github.com:scalvert/ember-sinon-sinoff.git`\n- `cd ember-sinon-sinoff`\n- `yarn`\n\n### Running Tests\n\n- `yarn test`\n- `ember test`\n- `ember test --server`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalvert%2Fember-sinon-sinoff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalvert%2Fember-sinon-sinoff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalvert%2Fember-sinon-sinoff/lists"}