Repository navigation
Add factory functions for sandbox and fake server - #1515
Merged
Merged
Conversation
This adds the following methods as aliases: - createSandbox = sandbox.create - createFakeServer = fakeServer.create - createFakeServerWithClock = fakeServerWithClock.create
mantoni
force-pushed
the
create-factory-functions
branch
from
August 6, 2017 14:57
8bad63c to
6648f1b
Compare
mantoni
commented
Aug 6, 2017
| sinon = proxyquire("../lib/sinon", { | ||
| nise: fakeNise | ||
| nise: fakeNise, | ||
| "./sinon/sandbox": fakeSandbox |
Member
Author
There was a problem hiding this comment.
I have to go through proxyquire to get the correct reference to the sandbox instance. I tried using a reference to the sandbox module directly, which worked on node but it failed in browsers.
fatso83
approved these changes
Aug 7, 2017
fatso83
left a comment
Contributor
There was a problem hiding this comment.
Fine by me. Does not see the need to document the old functions.
lencioni
added a commit
to lencioni/sinon-sandbox
that referenced
this pull request
Jul 3, 2018
This method was added in sinon v3.10.0: sinonjs/sinon#1515 and a deprecation warning for sinon.sandbox.create was added in sinon v5.0.1: - sinonjs/sinon#1768 - sinonjs/sinon@4fc7c65d#diff-7ac78866bb2aab0e4513c3e57f189c88R50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As discussed in #1514, this adds the following methods as aliases:
createSandbox=sandbox.createcreateFakeServer=fakeServer.createcreateFakeServerWithClock=fakeServerWithClock.createAlso adjusted the docs to show the new functions. Is it okay to suggest the new functions only? Or do we want to keep API docs for the "old" functions?
Did I miss anything else?