Files
cypress/docs/source/api/commands/debug.md
T
2017-05-23 17:17:27 -04:00

43 lines
891 B
Markdown

---
title: debug
comments: true
description: ''
---
`cy.debug` sets a `debugger` and logs the subject from the previous command.
Make sure you have your Developer Tools open for `cy.debug` to hit the breakpoint.
| | |
|--- | --- |
| **Returns** | the subject from the previous command for further chaining. |
| **Timeout** | *cannot timeout* |
# [cy.debug()](#usage)
Debug the previous command.
# Options
Pass in an options object to change the default behavior of `cy.debug`.
**cy.debug(*options* )**
Option | Default | Notes
--- | --- | ---
`log` | `true` | whether to display command in command log
# Usage
## Log out the current subject for debugging
```javascript
// Cypress will log out the current subject and other
// useful debugging information to your console
cy.get('a').debug().should('have.attr', 'href')
```
# See also
- [pause](https://on.cypress.io/api/pause)