This package, `sinon-stub-framework`, is a minimalistic wrapper that directly re-exports the entire `sinon` library. Its primary function appears to have been to provide the `sinon` package under an alternative name, possibly for historical or specific project reasons. Currently at version 1.0.4, the package has not seen updates in approximately five years (as of early 2026), suggesting it is effectively abandoned. There is no unique functionality, API, or release cadence separate from `sinon` itself, which is a mature and actively maintained library for test spies, stubs, and mocks. Users are strongly advised to install and use `sinon` directly instead of this wrapper to ensure they receive the latest features, bug fixes, and security updates.
npm install sinon-stub-frameworkVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of Sinon stubs, showing how to replace a method's implementation, control its return values, and restore the original function after tests. This code is functionally identical to using `sinon` directly.
Migrate all imports and dependencies directly to `sinon`. Uninstall `sinon-stub-framework` and install `sinon`.
Always use `sinon` directly to control your dependency version and benefit from the latest updates and documentation.
Switch to ES Module imports (`import { ... } from 'sinon';`) and use the `sinon` package directly. Ensure your project is configured for ESM.Ensure the stub variable is correctly assigned the return value of `sinon.stub()` and that `restore()` is called only once per stub in an appropriate cleanup hook (e.g., `afterEach`). If using a `sinon.sandbox`, use `sandbox.restore()` instead.
Verify that `myObject` and `myMethod` are correctly spelled and accessible at the point where `sinon.stub(myObject, 'myMethod')` is called. Ensure the method isn't being stubbed on an instance that's different from the one being tested.