-
-
Notifications
You must be signed in to change notification settings - Fork 775
Issue 1598 (Feature Request): sandbox.createStubInstance #1602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 1598 (Feature Request): sandbox.createStubInstance #1602
Conversation
… tests, and documentation.
| "test": "run-s test-node test-headless test-webworker", | ||
| "check-dependencies": "dependency-check package.json --unused --no-dev", | ||
| "build": "./build.js", | ||
| "build": "node ./build.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was necessary to run npm build or npm test locally on a Windows box. If it's inappropriate, then I'll happily revert this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine. At some point we agreed that it was not a pre-requisite that the entire build process runs on Windows, as none of the maintainers were using it, but we are certainly not opposed to improving the situation :-)
| assert.isFunction(collection.mock); | ||
| }); | ||
|
|
||
| describe(".createStubInstance", function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests have largely been copied from stub-test.js.
|
Do I need to add any additional tests in sadnbox-test.js? |
fatso83
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thank you 🚀 This has become |
Purpose (TL;DR) - mandatory
Fix issue #1598 by implementing sandbox.createStubInstance(), tests, and documentation.
Background (Problem in detail) - optional
The addition of sandbox.createStubInstance() increases orthogonality with the Sinon stub interface.
Solution - optional
Implemented sandbox.createStubInstance() as a convenience wrapper around sandbox.stub(), for the case of stubbing an entire object.
How to verify - mandatory
npm installnpm testChecklist for author
npm run lintpasses