Skip to content
This repository was archived by the owner on Dec 12, 2020. It is now read-only.

Conversation

@bahmutov
Copy link
Contributor

import Hello from './Hello.vue'
import { mount } from 'cypress-vue-unit-test'
import * as GreetingModule from './greeting'

cy.stub(GreetingModule, 'greeting').returns('Cypress').as('greeting')
mount(Hello)
cy.contains('Hello, Cypress!')
// confirm the stub was called
cy.get('@greeting').should('have.been.calledOnce')

@bahmutov bahmutov merged commit 35d2092 into master Jun 30, 2020
@bahmutov
Copy link
Contributor Author

mocking

@bahmutov
Copy link
Contributor Author

🎉 This PR is included in version 2.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

JessicaSachs pushed a commit to cypress-io/cypress that referenced this pull request Sep 29, 2020
```js
import Hello from './Hello.vue'
import { mount } from 'cypress-vue-unit-test'
import * as GreetingModule from './greeting'

cy.stub(GreetingModule, 'greeting').returns('Cypress').as('greeting')
mount(Hello)
cy.contains('Hello, Cypress!')
// confirm the stub was called
cy.get('@Greeting').should('have.been.calledOnce')
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show example with mocking ES6 import

2 participants