-
-
Notifications
You must be signed in to change notification settings - Fork 768
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
Added docs code snippet for createStubInstance #1423
Conversation
I couldn't think of a third sentence that added to the docs :) but am open to proposals.
docs/release-source/release/utils.md
Outdated
@@ -30,7 +30,17 @@ Restores supplied method | |||
|
|||
#### `sinon.createStubInstance(constructor);` | |||
|
|||
Creates a new object with the given function as the protoype and stubs all implemented functions. |
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.
Not sure if this is an improvement. A class IS A function along with its prototype. It's not either/or. Might help the ones that don't know the basics, but still...
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.
Agreed. Having an explanation that says function
and a code snippet with a class
should be fine.
contains(item) { /* ... */ } | ||
} | ||
|
||
var stubContainer = sinon.createStubInstance(Container); |
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.
Nice
Thank you @JoshuaKGoldberg! |
I couldn't think of a third sentence that added to the docs :) but am open to proposals.
Fixes #1421.