---
id: app/references/bundled-libraries
title: Bundled Libraries in Cypress
description: >-
  Cypress bundles Mocha, Chai, Chai-jQuery, Sinon, Sinon-Chai, Lodash, jQuery,
  and more, so you can write tests immediately with no extra installation or
  configuration.
section: app
source_path: docs/app/references/bundled-libraries.mdx
version: 58fe37da39eb8c609113be4464c25c595e9f2b59
updated_at: '2026-08-20T21:57:41.703Z'
---
# Bundled Libraries

Cypress ships with a set of proven open source testing libraries built in: [Mocha](https://mochajs.org/) structures your tests, [Chai](https://www.chaijs.com/) powers your assertions, and [Sinon](https://sinonjs.org/) provides spies and stubs, alongside utility libraries like [Lodash](https://lodash.com/) and [jQuery](https://jquery.com/). You don't install, import, or configure any of them. They're bundled inside Cypress and ready to use in every test.

If you've written JavaScript tests before, these tools will feel familiar, and what you already know about them carries over directly to Cypress.

## What's included

| Library | What it does | How you use it in Cypress |
| --- | --- | --- |
| [Mocha](#Mocha) | Test framework and runner syntax | `describe()`, `it()`, `beforeEach()`, and other hooks |
| [Chai](#Chai) | Assertion library | `expect()`, `assert()`, and [`.should()`](/llm/markdown/api/commands/should.md) |
| [Chai-jQuery](#Chai-jQuery) | DOM-specific assertions | Chainers like `have.class` and `be.visible` on DOM subjects |
| [Sinon](#Sinon) | Spies, stubs, and fake timers | [`cy.spy()`](/llm/markdown/api/commands/spy.md), [`cy.stub()`](/llm/markdown/api/commands/stub.md), [`cy.clock()`](/llm/markdown/api/commands/clock.md), [`Cypress.sinon`](/llm/markdown/api/utilities/sinon.md) |
| [Sinon-Chai](#Sinon-Chai) | Assertions on spies and stubs | Chainers like `have.been.calledOnce` |
| [Lodash](#Utility-libraries) | General-purpose utility functions | [`Cypress._`](/llm/markdown/api/utilities/_.md) |
| [jQuery](#Utility-libraries) | DOM traversal and manipulation | [`Cypress.$`](/llm/markdown/api/utilities/$.md) |
| [minimatch](#Utility-libraries) | Glob pattern matching | [`Cypress.minimatch`](/llm/markdown/api/utilities/minimatch.md) |
| [blob-util](#Utility-libraries) | Blob and base64 conversion | [`Cypress.Blob`](/llm/markdown/api/utilities/blob.md) |
| [Buffer](#Utility-libraries) | Binary data handling in the browser | [`Cypress.Buffer`](/llm/markdown/api/utilities/buffer.md) |
| [Bluebird](#Utility-libraries) | Promise library | [`Cypress.Promise`](/llm/markdown/api/utilities/promise.md) |

Cypress always uses its own bundled versions of these libraries. Installing a different version of Mocha, Chai, or Sinon in your project won't change the version Cypress runs, and no version needs to be installed for Cypress to work.

If you write your tests in TypeScript, note that Cypress also ships type definitions for these bundled globals. Projects that install `@types/chai` or `@types/jquery`, or that run Jest alongside Cypress, can end up with clashing global types. See [Configure tsconfig.json](/llm/markdown/app/tooling/typescript-support.md#Configure-tsconfigjson) and [Clashing types with Jest](/llm/markdown/app/tooling/typescript-support.md#Clashing-types-with-Jest) for the recommended setup.

## Mocha

Cypress uses [Mocha](https://mochajs.org/)'s `bdd` interface to structure and run your tests. Every test you write, whether end-to-end or component, sits on the harness Mocha provides:

*   [`describe()`](https://mochajs.org/#bdd)
*   [`context()`](https://mochajs.org/#bdd)
*   [`it()`](https://mochajs.org/#bdd)
*   [`before()`](https://mochajs.org/#hooks)
*   [`beforeEach()`](https://mochajs.org/#hooks)
*   [`afterEach()`](https://mochajs.org/#hooks)
*   [`after()`](https://mochajs.org/#hooks)
*   [`.only()`](https://mochajs.org/#exclusive-tests)
*   [`.skip()`](https://mochajs.org/#inclusive-tests)

```
describe('Checkout', () => {
  beforeEach(() => {
    cy.visit('/cart')
  })

  it('completes an order', () => {
    // test body
  })
})
```

Cypress extends Mocha under the hood, smoothing over edge cases and improving error messages. These changes are transparent: you write standard Mocha syntax, and Cypress handles the rest.

Read our guide on [writing and organizing tests](/llm/markdown/app/core-concepts/writing-and-organizing-tests.md) for how to structure specs with Mocha's syntax.

## Chai

While Mocha structures your tests, [Chai](https://www.chaijs.com/) gives you readable assertions with clear error messages. Every assertion in Cypress is built on Chai, and you can use it two ways:

*   **Implicitly**, by chaining [`.should()`](/llm/markdown/api/commands/should.md) or [`.and()`](/llm/markdown/api/commands/and.md) off a Cypress command. Cypress applies the Chai assertion to the command's [subject](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions) and retries it until it passes or times out.
*   **Explicitly**, with the globally available `expect` and `assert` functions.

```
// implicit, retried automatically
cy.get('[data-testid="greeting"]').should('contain', 'Jane')

// explicit
expect(user.name).to.equal('Jane')
```

The bundled Chai is also extensible. Install any Chai plugin, register it with `chai.use()` in your [support file](/llm/markdown/app/core-concepts/writing-and-organizing-tests.md#Support-file), and its assertions work in both `expect()` and `.should()`. See [Adding New Assertions](/llm/markdown/app/references/assertions.md#Adding-New-Assertions) for details.

See the full [list of available Chai assertions](/llm/markdown/app/references/assertions.md#Chai).

## Chai-jQuery

Most end-to-end assertions are about the DOM. Cypress bundles [Chai-jQuery](https://github.com/chaijs/chai-jquery), which extends Chai with jQuery-specific chainers, so you can assert directly on the elements your commands yield:

```
cy.get('[data-testid="submit"]').should('have.class', 'active')
cy.get('[data-testid="modal"]').should('be.visible')
```

See the full [list of available Chai-jQuery assertions](/llm/markdown/app/references/assertions.md#Chai-jQuery).

## Sinon

When you need to verify or control how functions behave, Cypress provides [Sinon](https://sinonjs.org/)'s test doubles through built-in commands:

*   [`cy.spy()`](/llm/markdown/api/commands/spy.md) wraps a function to record its calls without changing its behavior.
*   [`cy.stub()`](/llm/markdown/api/commands/stub.md) replaces a function and controls its behavior.
*   [`cy.clock()`](/llm/markdown/api/commands/clock.md) and [`cy.tick()`](/llm/markdown/api/commands/tick.md) control time in your application using Sinon's fake timers.

Cypress also exposes the full library as [`Cypress.sinon`](/llm/markdown/api/utilities/sinon.md), so Sinon's matchers and other APIs are available anywhere in your tests.

Read our guide on [stubs, spies, and clocks](/llm/markdown/app/guides/stubs-spies-and-clocks.md) for patterns and examples.

## Sinon-Chai

To assert on spies and stubs with the same `.should()` syntax you use everywhere else, Cypress bundles [Sinon-Chai](https://github.com/cypress-io/sinon-chai), which extends Chai with Sinon-specific chainers:

```
const stub = cy.stub().as('alert')

cy.on('window:alert', stub)
cy.get('[data-testid="delete"]').click()
cy.get('@alert').should('have.been.calledOnce')
```

See the full [list of available Sinon-Chai assertions](/llm/markdown/app/references/assertions.md#Sinon-Chai).

## Utility libraries

Cypress also bundles these libraries on the `Cypress` object. They're available anywhere in your tests, with no imports required:

*   [`Cypress._`](/llm/markdown/api/utilities/_.md): [Lodash](https://lodash.com/), for working with arrays, objects, and data transformations.
*   [`Cypress.$`](/llm/markdown/api/utilities/$.md): [jQuery](https://jquery.com/), for DOM traversal outside of Cypress commands. DOM commands like [`cy.get()`](/llm/markdown/api/commands/get.md) also yield jQuery objects.
*   [`Cypress.minimatch`](/llm/markdown/api/utilities/minimatch.md): [minimatch](https://github.com/isaacs/minimatch), for testing glob patterns against URLs or paths.
*   [`Cypress.Blob`](/llm/markdown/api/utilities/blob.md): [blob-util](https://github.com/nolanlawson/blob-util), for converting between blobs, base64 strings, and other binary formats.
*   [`Cypress.Buffer`](/llm/markdown/api/utilities/buffer.md): a [Buffer polyfill](https://github.com/feross/buffer) for working with binary data in the browser, such as file uploads.
*   [`Cypress.Promise`](/llm/markdown/api/utilities/promise.md): [Bluebird](https://github.com/petkaantonov/bluebird), for creating and managing promises inside your tests.

## See also

*   [Assertions reference](/llm/markdown/app/references/assertions.md): every Chai, Chai-jQuery, and Sinon-Chai assertion available in Cypress
*   [Introduction to Cypress](/llm/markdown/app/core-concepts/introduction-to-cypress.md)
*   [Writing and Organizing Tests](/llm/markdown/app/core-concepts/writing-and-organizing-tests.md)
*   [Stubs, Spies, and Clocks](/llm/markdown/app/guides/stubs-spies-and-clocks.md)
*   [Troubleshooting](/llm/markdown/app/references/troubleshooting.md)
