Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sinon

Package Overview
Dependencies
Maintainers
2
Versions
208
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sinon - npm Package Versions

1
1920

1.2.0

Diff

Changelog

Source

1.2.0

  • Bug fix: abort() switches state to DONE when OPENED and sent. Fix by Tristan Koch.
  • Bug fix: Mootools uses MSXML2.XMLHTTP as objectId, which Sinon matched with different casing. Fix by Olmo Maldonado.
  • Bug fix: When wrapping a non-owned property, restore now removes the wrapper instead of replacing it. Fix by Will Butler.
  • Bug fix: Make it possibly to stub Array.prototype.push by not using that method directly inside Sinon.
  • Bug fix: Don't assume that req.requestBody is a string in the fake server.
  • Added spy.printf(format) to print a nicely formatted message with details about a spy.
  • Garbage collection: removing fakes from collections when restoring the original methods. Fix by Tristan Koch.
  • Add spy.calledWithNew to check if a function was used as a constructor
  • Add spy.notCalledWith(), spy.neverCalledWith() and sinon.assert.neverCalledWith. By Max Antoni
  • Publicly expose sinon.expectation.fail to allow tools to integrate with mock expectations.
  • Fake XMLHttpRequests now support a minimal portion of the events API, making them work seamlessly with e.g. SproutCode (which uses xhr.addEventListener("readystatechange"). Partially by Sven Fuchs.
published 1.1.1 •

Changelog

Source

1.1.1

  • Fix broken mock verification in CommonJS when not including the full Sinon package.
published 1.1.0 •

Changelog

Source

1.1.0

  • The fake server now has a autoRespond method which allows it to respond to requests on the fly (asynchronously), making it a good fit for mockup development
  • Stubs and spies now has a withArgs method. Using it allows you to create several spies/stubs for the same method, filtered by received arguments
  • Stubs now has yields and yieldsTo methods for fuzzily invoking callbacks. They work like callsArgAt only by inferring what callback to invoke, and yieldsTo can invoke callbacks in object "options" arguments.
  • Allow sandboxes/collections to stub any property so long as the object has the property as an own property
  • Significantly improve error reporting from failed mock expectations. Now prints all met and unmet expectations with expected and received arguments
  • Allow mock expectations to be consumed in any order
  • Add pretty printing of all calls when assertions fail
  • Fix bug: Stub exception message ended up as "undefined" (string) if not specified
  • Pass capture groups in URLs to fakeServer function handlers
  • Pass through return value from test function in testCase
  • typeof require is not enough to assume node, also use typeof module
  • Don't use Object.create in sinon.create. In the off chance that someone stubs it, sinon will fail mysteriously (Thanks to Espen Dalløkken)
  • Catch exceptions when parsing DOM elements "on a hunch" When responding to XHRs, Sinon acts like most browsers and try to parse the response into responseXML if Content-Type indicates XML or HTML. However, it also does this if the type is not set. Obviously, this may misfire and should be caught.
  • Fix fakeServer.respond() to not drop requests when they are queued during the processing of an existing queue. (Sven Fuchs)
  • Clean up module loading in CommonJS environments (Node.js still the only tested such environment). No longer (temporarily) modifies require.paths, always loads all modules.
published 1.0.2 •

Changelog

Source

1.0.2

  • Fix JSON bug in package.json
  • Sandbox no longer tries to use a fake server if config says so, but server is not loaded
published 0.6.2 •

Changelog

Source

0.6.2

  • Fixed another bug in sinon.fakeServerWithClock where consecutive respond() calls did not trigger timeouts.
published 0.6.3 •

published 1.0.0 •

Changelog

Source

1.0.0

  • Switched indentation from 2 to 4 spaces :)

  • Node.js compatibility improvements

  • Remove magic booleans from sinon.assert.expose, replace with option object

  • Put QUnit adapter in its own repository

  • Update build script to build standalone timers and server files

  • Breaking change: thisObj -> thisValue Change brings consistency to the code-base, always use thisValue

  • Add sinon.assert.pass callback for successful assertions

  • Extract sandbox configuration from sinon.test

    Refactored sinon.test to not do all the heavy lifting in creating sandbox objects from sinon.config. Now sinon.sandbox.create accepts an optional configuration that can be retrieved through sinon.getConfig({ ... }) - or, to match previous behavior, through sinon.getConfig(sinon.config);

    The default configuration now lives in sinon.defaultConfig rather than the previous sinon.test.

    This change enables external tools, such as test framework adapters, to easily create configurable sandboxes without going through sinon.test

  • Rewrite sinon.clock.tick to fix bug and make implementation clearer

  • Test config load correct files

  • Make timers and XHR truly standalone by splitting the IE work-around in two files

  • Don't fail when comparing DOM elements in sinon.deepEqual (used in calledWith(...))

  • Should mirror properties on Date when faking it

  • Added and updated configuration for both JsLint and JavaScript lint

  • [August Lilleaas] The build script can optionally build a file without the version name in it, by passing 'plain', i.e. './build plain'.

    Useful when using the build script to build and use sinon programatically, so one can 'cp path/to/sinon/pkg/sinon.js my/scripts/'

  • [August Lilleaas] Checking and warning if we got a load error and rubygems isn't present.

  • [August Lilleaas] Updating build script to be runnable from any directory. Current working directory doesn't have to be repo root.

published 1.0.1 •

Changelog

Source

1.0.1

  • Make sure sinon.sandbox is exposed in node.js (fix by Gord Tanner)
1
1920
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc