HelloWorld.spec.ts 570 B

1234567891011121314151617181920212223242526
  1. import { mount } from '@cypress/vue'
  2. import { createTestingPinia } from '@pinia/testing'
  3. import HelloWorld from '@/components/HelloWorld.vue'
  4. it('Passes msg prop correctly', () => {
  5. mount(HelloWorld, {
  6. propsData: {
  7. msg: 'Hello World',
  8. },
  9. global: {
  10. plugins: [
  11. createTestingPinia({
  12. createSpy: (args) => {
  13. console.log('spy', args)
  14. return () => {
  15. console.log('spyreturns')
  16. }
  17. },
  18. }),
  19. ],
  20. },
  21. })
  22. cy.get('h2').should('contain.text', 'Hello World')
  23. })