{
  "doc": {
    "id": "app/references/bundled-libraries",
    "title": "Bundled Libraries in Cypress",
    "description": "Open source testing libraries bundled with Cypress",
    "section": "app",
    "source_path": "/llm/markdown/app/references/bundled-libraries.md",
    "version": "fa8f60eba6ec9a949b75fe9f9f5f6591719cd01f",
    "updated_at": "2026-05-05T21:21:10.048Z",
    "headings": [
      {
        "id": "app/references/bundled-libraries#bundled-libraries",
        "text": "Bundled Libraries",
        "level": 1
      },
      {
        "id": "app/references/bundled-libraries#mocha",
        "text": "Mocha",
        "level": 2
      },
      {
        "id": "app/references/bundled-libraries#chai",
        "text": "Chai",
        "level": 2
      },
      {
        "id": "app/references/bundled-libraries#chai-jquery",
        "text": "Chai-jQuery",
        "level": 2
      },
      {
        "id": "app/references/bundled-libraries#sinon-js",
        "text": "Sinon.js",
        "level": 2
      },
      {
        "id": "app/references/bundled-libraries#sinon-chai",
        "text": "Sinon-Chai",
        "level": 2
      },
      {
        "id": "app/references/bundled-libraries#other-library-utilities",
        "text": "Other Library Utilities",
        "level": 2
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "Bundled Libraries"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Cypress relies on many open source testing libraries to lend stability and familiarity to the platform from the get-go. If you've been testing in JavaScript, you'll recognize many old friends in this list."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Mocha"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "link",
            "title": null,
            "url": "http://mochajs.org/",
            "children": [
              {
                "type": "text",
                "value": "http://mochajs.org/"
              }
            ]
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Cypress has adopted Mocha's `bdd` syntax, which fits perfectly with both integration and unit testing. All of the tests you'll be writing sit on the fundamental harness Mocha provides, namely:"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "http://mochajs.org/#bdd",
                    "children": [
                      {
                        "type": "text",
                        "value": "`describe()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "http://mochajs.org/#bdd",
                    "children": [
                      {
                        "type": "text",
                        "value": "`context()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "http://mochajs.org/#bdd",
                    "children": [
                      {
                        "type": "text",
                        "value": "`it()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "http://mochajs.org/#hooks",
                    "children": [
                      {
                        "type": "text",
                        "value": "`before()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "http://mochajs.org/#hooks",
                    "children": [
                      {
                        "type": "text",
                        "value": "`beforeEach()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "http://mochajs.org/#hooks",
                    "children": [
                      {
                        "type": "text",
                        "value": "`afterEach()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "http://mochajs.org/#hooks",
                    "children": [
                      {
                        "type": "text",
                        "value": "`after()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "http://mochajs.org/#exclusive-tests",
                    "children": [
                      {
                        "type": "text",
                        "value": "`.only()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "http://mochajs.org/#exclusive-tests",
                    "children": [
                      {
                        "type": "text",
                        "value": "`.skip()`"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Additionally, Mocha gives us excellent "
          },
          {
            "type": "link",
            "title": null,
            "url": "http://mochajs.org/#asynchronous-code",
            "children": [
              {
                "type": "text",
                "value": "`async` support"
              }
            ]
          },
          {
            "type": "text",
            "value": ". Cypress has extended Mocha, sanding off the rough edges, weird edge cases, bugs, and error messages. These fixes are all completely transparent."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/writing-and-organizing-tests.md",
            "children": [
              {
                "type": "text",
                "value": "Check out our guide to writing and organizing tests."
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Chai"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "link",
            "title": null,
            "url": "http://chaijs.com/",
            "children": [
              {
                "type": "text",
                "value": "http://chaijs.com/"
              }
            ]
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "While Mocha provides us a framework to structure our tests, Chai gives us the ability to easily write assertions. Chai gives us readable assertions with excellent error messages. Cypress extends this, fixes several common pitfalls, and wraps Chai's DSL using "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions",
            "children": [
              {
                "type": "text",
                "value": "subjects"
              }
            ]
          },
          {
            "type": "text",
            "value": " and the "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/commands/should.md",
            "children": [
              {
                "type": "text",
                "value": "`.should()`"
              }
            ]
          },
          {
            "type": "text",
            "value": " command."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/references/assertions.md#Chai",
            "children": [
              {
                "type": "text",
                "value": "List of available Chai Assertions"
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Chai-jQuery"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "link",
            "title": null,
            "url": "https://github.com/chaijs/chai-jquery",
            "children": [
              {
                "type": "text",
                "value": "https://github.com/chaijs/chai-jquery"
              }
            ]
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "When writing integration tests, you will likely work a lot with the DOM. Cypress brings in Chai-jQuery, which automatically extends Chai with specific jQuery chainer methods."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/references/assertions.md#Chai-jQuery",
            "children": [
              {
                "type": "text",
                "value": "List of available Chai-jQuery Assertions"
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Sinon.js"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "link",
            "title": null,
            "url": "https://github.com/sinonjs/sinon",
            "children": [
              {
                "type": "text",
                "value": "https://github.com/sinonjs/sinon"
              }
            ]
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "When writing unit tests, or even in integration-like tests, you often need to ability to stub and spy methods. Cypress includes two methods, "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/commands/stub.md",
            "children": [
              {
                "type": "text",
                "value": "`cy.stub()`"
              }
            ]
          },
          {
            "type": "text",
            "value": " and "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/commands/spy.md",
            "children": [
              {
                "type": "text",
                "value": "`cy.spy()`"
              }
            ]
          },
          {
            "type": "text",
            "value": " that return Sinon stubs and spies, respectively."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Cypress also exposes a utility so that `sinon` can be called anywhere inside of your tests using "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/utilities/sinon.md",
            "children": [
              {
                "type": "text",
                "value": "`Cypress.sinon`"
              }
            ]
          },
          {
            "type": "text",
            "value": "."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/guides/stubs-spies-and-clocks.md",
            "children": [
              {
                "type": "text",
                "value": "Check out our guide for working with spies, stubs, and clocks."
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Sinon-Chai"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "link",
            "title": null,
            "url": "https://github.com/cypress-io/sinon-chai",
            "children": [
              {
                "type": "text",
                "value": "https://github.com/cypress-io/sinon-chai"
              }
            ]
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "When working with `stubs` or `spies` you'll regularly want to use those when writing Chai assertions. Cypress bundles in Sinon-Chai which extends Chai allowing you to "
          },
          {
            "type": "link",
            "title": null,
            "url": "https://github.com/cypress-io/sinon-chai",
            "children": [
              {
                "type": "text",
                "value": "write assertions"
              }
            ]
          },
          {
            "type": "text",
            "value": " about `stubs` and `spies`."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/references/assertions.md#Sinon-Chai",
            "children": [
              {
                "type": "text",
                "value": "List of available Sinon-Chai Assertions"
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Other Library Utilities"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Cypress also bundles the following tools on the `Cypress` object. These can be used anywhere inside of your tests."
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/utilities/_.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`Cypress._`"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": " (lodash)"
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/utilities/$.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`Cypress.$`"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": " (jQuery)"
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/utilities/minimatch.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`Cypress.minimatch`"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": " (minimatch.js)"
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/utilities/blob.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`Cypress.Blob`"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": " (Blob utils)"
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/utilities/buffer.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`Cypress.Buffer`"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": " (Buffer utils)"
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/utilities/promise.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`Cypress.Promise`"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": " (Bluebird)"
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  "token_estimate": 480
}