Skip to content

Latest commit

 

History

History
49 lines (42 loc) · 2.52 KB

File metadata and controls

49 lines (42 loc) · 2.52 KB

0.18.8

Released 02/05/2017

Overview:

  • We have officially implemented our Sinon.JS integration: adding cy.stub(), cy.spy(), cy.clock(), and cy.tick(). We've matched Sinon's APIs and added sinon-as-promised and chai-sinon. In addition we've fixed Sinon performance issues, and improved the display of assertion passes and failures.
  • These new APIs will work well in both unit tests and integration tests.

Features:

  • You can now use cy.stub() and cy.spy() synchronously. These both match the Sinon API identically. We will display stub/spy calls in the Command Log and provide the call count, arguments, context, and return values when you click on the log. Stubs are automatically reset between tests. Fixes #377.
  • We've added our own special aliasing flavor to cy.stub() and cy.spy(). You can use the .as() command and we will associate spy and stub invocations (the same way we do with XHR aliasing and route matching).
  • We've added cy.clock() and cy.tick() which are both asynchronous methods to modify timers in your application under test. We automatically apply clock (even if you invoke it before your first cy.visit()) and will automatically reapply it after page load. cy.tick() will enable you to control the amount of time you want passed in your application. This is great for controlling throttled or debounced functions.
  • sinon-as-promised is automatically applied under the hood which extends Sinon and provides the .resolves(...) and .rejects(...) APIs which makes it easy to stub promise returning functions.
  • We support and display multiple sub spies when using Sinon's .withArgs(...) function.

Misc:

  • We've enhanced chai-sinon by improving the output during passes or failures. Fixes #31.
  • We've ripped out Sinon's argument serialization in favor of our own.
  • We no longer send Sinon to the remote application under test. In other words, you'll no longer see sinon.js being sent as a network request.
  • Deprecated the undocumented cy.agents function, but it will continue to work and will be officially removed later.