https://cypress.io logo
Join Discord
Powered by
# vue
  • b

    bulky-sundown-74498

    04/15/2021, 4:42 PM
    The problem with setting up things globally that you forget about is that. quickly, they become hard to track
  • b

    bulky-sundown-74498

    04/15/2021, 4:43 PM
    If it can be explicit and you do not loose too much time or maintainability by making it explicit, it creates tracability of failure, which is what you want to help you code faster
  • b

    bulky-sundown-74498

    04/15/2021, 4:43 PM
    TDD is supposed to make you more productive, not loose time tracking which setup you failed 😉
  • l

    little-shampoo-74692

    04/15/2021, 4:44 PM
    It's what we do in Jest as well. I just didn't see the 'new' in the actual export. An easy thing to miss.
  • b

    bulky-sundown-74498

    04/15/2021, 4:44 PM
    So now, you could setup a
    debugger;
    within your mount function to see what setup is working
  • l

    little-shampoo-74692

    04/15/2021, 4:45 PM
    Whoever is working on this, does that all make sense?
  • l

    little-shampoo-74692

    04/15/2021, 4:46 PM
    @User you can setup repetitive code as recursive to help speed it up. It is what it is.
  • l

    little-shampoo-74692

    04/15/2021, 4:49 PM
    I think this is one of the reasons we hate testing so much. We have to test each and every input and output and it's tedious (not to mention somewhat of just a self-reassurance).
  • l

    little-shampoo-74692

    04/15/2021, 4:50 PM
    Reminds me of checking my own answers in math class. (And who enjoys that?)
  • b

    bulky-sundown-74498

    04/15/2021, 4:50 PM
    In my case I hated component testing... until I tried it with cypress
  • b

    bulky-sundown-74498

    04/15/2021, 4:50 PM
    will post a blogpost soon about it
  • b

    bulky-sundown-74498

    04/15/2021, 4:51 PM
    It is now less painful to find what I want to test and why
  • b

    bulky-sundown-74498

    04/15/2021, 4:51 PM
    because I see it
  • b

    bulky-sundown-74498

    04/15/2021, 4:51 PM
    and can inspect/debug
  • r

    red-refrigerator-13075

    04/15/2021, 4:51 PM
    Well I think the mount helper that @User sid could work, because setting up each test file with the same line to add vue-i18n doesn't make sense for me but maybe in the future that could change
  • l

    little-shampoo-74692

    04/15/2021, 4:51 PM
    I'm interested to dive in. I haven't had a chance to look at it. But I've discussed it with my team and we may be implementing it into our flow. I think there is some concern that with browser-lead testing there may be a desire to test "is that really rendering blue", etc..
  • r

    red-refrigerator-13075

    04/15/2021, 4:52 PM
    That could be awesome, because as I said, many Vue developers will face the same issue jejeje
  • l

    little-shampoo-74692

    04/15/2021, 4:52 PM
    As for myself, I see this as the future of testing (thank goodness!).
  • l

    little-shampoo-74692

    04/15/2021, 4:54 PM
    So let's discuss TDD with Cypress.
  • l

    little-shampoo-74692

    04/15/2021, 4:55 PM
    Usually we have some Dom elements build (or at least in mind) for what we're trying to do.
  • r

    red-refrigerator-13075

    04/15/2021, 4:55 PM
    The next step after making the helper function is going to be to add vuetify to the mix and see what other errors come out to bother you guys again hehehehe.
  • l

    little-shampoo-74692

    04/15/2021, 4:59 PM
    You know what? I'm just going to have to dive into this and see what it's all about. I don't really think there's much more to it. Looks like you have a PS course, so I'll be spending some time with that to get up to speed.
  • r

    red-refrigerator-13075

    04/15/2021, 5:03 PM
    @User Any idea how can you listen and assert emits like in vue-test-utils? With vue-test-utils:
    expect(wrapper.emitted('click')).toBeTruthy()
  • b

    bulky-sundown-74498

    04/15/2021, 5:10 PM
    mount(SuperComponent).then(({wrapper}) => { })
  • b

    bulky-sundown-74498

    04/15/2021, 5:11 PM
    cf Jess's talk
  • r

    red-refrigerator-13075

    04/15/2021, 5:11 PM
    ok ok I'll try it later
  • b

    bulky-sundown-74498

    04/15/2021, 5:12 PM
    But this should be fine
  • b

    bulky-sundown-74498

    04/15/2021, 5:16 PM
    actually my bad...
  • b

    bulky-sundown-74498

    04/15/2021, 5:16 PM

    https://www.youtube.com/watch?v=Abwi_X107GYâ–¾

  • b

    bulky-sundown-74498

    04/15/2021, 5:17 PM
    Copy code
    js
    mount(SuperComponent).then(() => {
      cy.vue().then(wrapper => expect(wrapper.emitted('click')).to.have.length(1))
    })
1...181920...37Latest