Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jim Strother
    @jstrother
    I'm running into a new issue. I'm in chapter 6 - Writing Data - Unit Testing the Store. All of the unit tests to this point are passing, but the e2e test is still giving the same timeout error:
    CypressError: Timed out retrying: cy.wait() timed out waiting 5000ms for the 1st request to the route: 'addRestaurant'. No request ever occurred.
    Josh Justice
    @CodingItWrong

    @jstrother thanks for the repo, I should be able to check it out in the morning

    I'd recommend confirming (1) that the axios request is being reached and (2) that it's named "addRestaurant" in your cypress test

    Jim Strother
    @jstrother
    I'm pretty confident that the axios request is being reached as the other e2e test is passing just fine. I also double-checked the "addRestaurant" spelling. I got tired of searching for a random typo in my code and copied yours straight over, put my API key in, and tried again. Still no luck. :(
    Josh Justice
    @CodingItWrong

    OK, I ran your code locally. It looks like you've reached this point in the tutorial: https://outsidein.dev/vue/6-writing-data.html#creating-the-api-method

    If you open the browser console in Cypress, you'll see the error "TypeError: t.createRestaurant is not a function" described in the tutorial. The tutorial describes where to go from there.

    From a troubleshooting standpoint, note that the Axios request is not yet actually implemented in the code, and no network request appears in the Network tab of the browser tools.

    @jstrother
    I'll add some notes at that point in the tutorial to clarify that the symptom you'll see in Cypress is the timeout.
    Jim Strother
    @jstrother
    Ok, thanks!
    Also, thanks for this tutorial! Testing is something I've always struggled with, and I appreciate what you've got here.
    Josh Justice
    @CodingItWrong
    You're welcome, I'm glad it's helpful!
    Eric
    @ericledonge

    Hello @CodingItWrong, I've finished your wonderful tutorial. Thanks a lot for this highly valuable material!

    Now, I'd like to learn more about clean architecture, how to separate business and ui logics with use cases/entities or maybe with business custom hooks. Do you have any advices to dive into those topics, please?

    It's hard to find that kind of things for frontend.
    Josh Justice
    @CodingItWrong

    @ericledonge you're right, I haven't been able to find much information on clean architectural style code for the frontend either. For Vue and React so far I've stuck closer to "standard" frontend architecture.

    If anyone has done it, it's James Shore. He has a resource http://www.letscodejavascript.com/ that is somewhat dated but takes the approach you describe. If you ignore some of the older build tooling stuff, I'm sure there will be helpful architectural principles in there.

    Bernard Amofah
    @bamofah
    hi restarting the tutorial (sort of lost tack of where I got up to) can this also be done using NextJs (wondering how much work it would take.)
    ah another question... do you have any insight on using bitbucket-pipelines over github actions
    Josh Justice
    @CodingItWrong

    @bamofah I haven't tried nextjs so I'm not sure. Your safest bet may be doing the tutorial in normal react, then afterward trying to apply the techniques to next and see what is or isn't similar

    I haven't used bitbucket pipelines, but our use of CI is very simple here, so I'm sure there are tutorials out there for how to run jest and cypress on bitbucket that would be compatible with this approach

    Bernard Amofah
    @bamofah
    @CodingItWrong i think that is fair. Will crack on. with it. Thanks again for the great tutorial.
    Josh Justice
    @CodingItWrong
    @bamofah you're welcome!
    Ray Jasson
    @rayjasson98
    Thanks for the tutorial! It's really helpful for a beginner in TDD.
    Josh Justice
    @CodingItWrong
    🎉
    Minhaj-ul-abidin
    @Minhaj-ul-abidin
    Thanks for the tutorial. Loved how you go into detail with the why and when of the steps.
    Josh Justice
    @CodingItWrong
    @Minhaj-ul-abidin that's great to hear! I feel like testing unavoidably involves judgment calls, so it's especially important to understand the "why" so you can make those calls for your situation
    Devjyoti Ghosh
    @DevTGhosh_twitter
    @CodingItWrong thanks for the great resource. I am going through the exercise and spent 2 hrs trying to get cypress to work on my machine. The issue was I was running WSL2 and cypress has its own gui which WSL doesn't permit normally. This stackoverflow issue solved it for me maybe you can add a small note in the tutorial for users like me. Cheers I am looking forward to going through the rest of the exercise.
    Josh Justice
    @CodingItWrong
    Thanks @DevTGhosh_twitter, I'm sorry that challenge happened for you. That seems worth it for me to reference in a note, yes 👍
    Devjyoti Ghosh
    @DevTGhosh_twitter
    Great. Created a GitHub issue on cypress for other people to find it. Hopefully won't be needed after Windows starts supporting WSL2 GUI by the end of the year.