---
title: "0.18.8"
url: "https://www.cypress.io/releases/0-18-8"
description: "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…"
---

# 0.18.8

ReleasedReleased on February 4, 2017

**Overview:**

-   We have officially implemented our [Sinon.JS](http://sinonjs.org/) integration: adding [`cy.stub()`](/api/commands/stub), [`cy.spy()`](/api/commands/spy), [`cy.clock()`](/api/commands/clock), and [`cy.tick()`](/api/commands/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()`](/api/commands/stub) and [`cy.spy()`](/api/commands/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](https://github.com/cypress-io/cypress/issues/377).
    
-   We've added our own special aliasing flavor to [`cy.stub()`](/api/commands/stub) and [`cy.spy()`](/api/commands/spy). You can use the [`.as()`](/api/commands/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()`](/api/commands/clock) and [`cy.tick()`](/api/commands/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()`](/api/commands/visit)) and will automatically reapply it after page load. [`cy.tick()`](/api/commands/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](https://github.com/cypress-io/cypress/issues/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.