Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe expose the fact that this method really is part of the sandbox? As in
sandbox.createStubInstance...
. Otherwise people might mix bothsinon
andsandbox
invocations in the same file, I think.Whatcha think?
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.
@fatso83 Yeah I wasn't even aware of that. Here's my knee-jerk thought: on this line, I think changing
sinon
tosandbox
might confuse the reader more than it informs them: some readers may not know whatsandbox
is (yet) and assume they can't call this method onsinon
. Maybe that's a good thing, but thesandbox
docs say:This could be far-fetched, but they might extrapolate that to mean
createStubInstance
is only for "very advanced setup or need a special configuration," too. For all I know, that's the intended interpretation, but I'm assuming it's not. I'm assuming it's used more often than non-sinon
sandbox
es.That said, I do think this is useful information. Maybe it could be added as a detail below the header or in the link added by #2577 ?
I don't feel that strongly about anything I've said above: if you disagree with my take, I'm happy to make your suggested 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.
What about keeping the
sinon.create...
bits, but link to thesandbox.md
docs for more elaborate examples?