Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions docs/api/commands/stub.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ assertion. It is not retryable, chainable, or timeout-able.
```javascript
cy.stub()
cy.stub(object, method)
cy.stub(object, method, replacerFn)
```

### Usage
Expand All @@ -41,10 +40,6 @@ The `object` that has the `method` to be replaced.

The name of the `method` on the `object` to be wrapped.

<Icon name="angle-right" /> **replacerFn _(Function)_**

The function used to replace the `method` on the `object`.

### Yields [<Icon name="question-circle"/>](/guides/core-concepts/introduction-to-cypress#Subject-Management) {#Yields}

- `cy.stub()` is _synchronous_ and returns a value (the stub) instead of a
Expand Down Expand Up @@ -82,7 +77,7 @@ expect(util.addListeners).to.be.called
// assume App.start calls util.addListeners
let listenersAdded = false

cy.stub(util, 'addListeners', () => {
cy.stub(util, 'addListeners').callsFake(() => {
listenersAdded = true
})

Expand Down