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.
#2.0.0-pre / 2015-12-02
CommonJSify sinon utils package
CommonJSify
sinon.mock
util/fake_server_with_clock
into a CommonJS moduleThis module no-longer mutates the
sinon
object; instead it exports an API which is then added to thesinon
global by thelib/sinon.js
entrypoint.util/fake_server
into a CommonJS module.This module no-longer mutates the
sinon
object; instead it exports an API which is then added to thesinon
global by thelib/sinon.js
entrypoint.This module still depends on the
sinon
object as the tests are tightly coupled tosinon.useFakeXMLHttpRequest
and friends; once the tests are migrated to CommonJS we should be able to rectify this.util/fake_timers
into a CommonJS module.This module no-longer mutates the
sinon
object; instead it exports an API which is then added to thesinon
global by thelib/sinon.js
entrypoint.util/fake_xml_http_request
into a CommonJS module.This module no-longer mutates the
sinon
object; instead it exports an API which is then added to thesinon
global by thelib/sinon.js
entrypoint.This module still relies on the sinon object as the tests are tightly coupled to
sinon.logError
(they stub it to prevent uncaught exceptions); we should be able to resolve this once the tests are CommonJSified.I have reservations on the way
useFakeXMLHttpnRequest
mutatesFakeXMLHttpRequest
however I feel this is best refactored post the CommonJS transition.util/fake_xdomain_request
into a CommonJS module.This module no-longer mutates the
sinon
object; instead it exports an API which is then added to thesinon
global by thelib/sinon.js
entrypoint.I have reservations on the way
useFakeXDomainRequest
mutatesFakeXDomainRequest
however I feel this is best refactored post the CommonJS transition.util/event
into a CommonJS module.This module no-longer mutates the
sinon
object; instead it exports an API which is then added to thesinon
global by thelib/sinon.js
entrypoint.sinon.logError
into a CommonJS module.This is a tricky one; it remains exported on the
sinon
object as there are a number of tests tightly coupled to it. Once the tests are migrated to CommonJS we should be able to import it directly and remove the export onto the sinon object.This module still needs to depend on the
sinon
object as the tests are tightly coupled to bothsinon.stub
andsinon.mock
; once the tests have been migrated to CommonJS this module can be made stand-alone.sinon.mock
into a CommonJS module.Extract,
sinon.expectation
, an inner module into its own CommonJS module (mock-expectation
). This is still exported on thesinon
object to satisfy tests.createSpyCall
into a CommonJS module.Similar to
spy.js
, the tests have a hard dependency onsinon.format
which can't be removed until the tests themselves are CommonJSify'dsinon.assert
into a CommonJS module.CommonJSify
sinon.stub
walk
from sinon's public API.Delete .jscsrc
sinon
import from stub... and we're done here! :D
sinon.behavior
into a CommonJS moduleNot part of the public API
sinon.walk
into a CommonJS module.No other references outside of stub, but according to the docs it's part of sinon's public API.
Move
createStubInstance
to be a member ofstub
; remove local references tosinon.stub
wrapMethod
as a CommonJS moduleHad to defer a couple of stub-tests which tightly coupled stub.js to
sinon.wrapMethod
; should be able to re-instate these when the test-suite is converted to use commonJSFollowing on from #909, this file is now redundant.
Ensure support for running inside a WebWorker
Related to the fixes in #908.
It turned out that although we support running Sinon inside
a WebWorker, we do not actually test this in any of the tests.
This test will be run by the test config of the packaged build.
As PhantomJS 1.9.8 does not implement WorkerGlobalScope, the
test if we are running in a WebWorker is a bit simplified, but
it works for us.
Commonjs-ified sinon.spy
Updated docs to reflect that calledOn accepts a matcher
Allow yieldsOn, callsArgOn on any defined context
Fix interaction with spy getters/setters - fixes #917
Remove unnecessary error variable
Prevent stubbed getter from being called during restore()
Allow requestBody in FakeXDomainRequest, FakeXMLHttpRequest for GET requests
As per the spec, they should be allowed. This removes them from the
blacklist (which now is just HEAD), and adds unit tests.
Use immediate exceptions
Remove JSCS from devDependencies
We haven't used it for awhile, let's stop installing it
Add a Gitter chat badge to README.md
Replaced switch statement in favor of object lookup
context
Add bithound badge to README.md
Allow prototype-less comparisons
Fixes #887
Fix #875 Proper support UTF8 payloads
New documentation site!
Add tests #1.17.2 / 2015-10-21
lib/sinon/util: Remove window conditionals from IE files.
The removed conditionals should not have any functional benefit, so in
that sense it's safe to remove these. (As described in #840.)
However, it appears that these conditionals have an unintended effect
in IE 11 and Edge 12, where the functions defined within the
conditionals actually stop working as expected. (See #848.)
While it is true these IE utils are not necessary for the newer IEs,
they are often still loaded as part of a generic test package.
Additionally, to make the ci-tests work:
They were included before, but didn't actually run because of the
if (typeof window !== 'undefined')
conditional. With the conditionalgone, just don't include them.
Closes #840.
Fixes #848.
With tests.
upgraded ESLint to 1.7.1 (latest and greatest)
Removed duplicate implementation of sinon.timesInWords
Make travis cache node_modules to speed up builds
Removed unneeded path resolution
Run tests in node 4.2 LTS (Argon)
CommonJS-ified some of the things