Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Safei Ashraf
    @Safei-Ashraf
    Hello, I had an issue with setting up CI during the course, the issue was addressed on the cypress repo, and they advised updating the github actions version, I resolved the issue on my end already and made a tiny PR to resolve it in the main repo as well, including a screenshot of the error and issue link on cypress repo. might need to update the course content with it as well : ) Thanks for the course man! am 100% enjoying it 😎
    PR CodingItWrong/opinion-ate-react#12
    Safei Ashraf
    @Safei-Ashraf
    image.png
    anyone got the same error when trying to generate an API key from the heroku link?
    Daniel Koch
    @dkprog
    I'm getting Error: self signed certificate
    Josh Justice
    @CodingItWrong
    @dkprog sorry about that; I'm in the progress of fixing the previously-reported api key errors. Hopefully will have the fix up within an hour. I'll post updates here
    Josh Justice
    @CodingItWrong
    @dkprog @Safei-Ashraf @tom751 Sorry for the API errors; I think they should be fixed now. I had to replace the backend with a different technology. I tried testing directly to it and it all seems to be working as before. In the next day or two I'll test it out against the actual React/Vue codebases, but if you run into any errors, please let me know here.
    I also want to apologize to everyone for not responding here. I messed up my notification settings so I wasn't hearing about messages. I should get them correctly now.
    Daniel Koch
    @dkprog
    @CodingItWrong Thank you very much!
    Josh Justice
    @CodingItWrong
    @Safei-Ashraf github actions version now updated on the site; thanks again for letting me know
    elov
    @elov:matrix.org
    [m]
    Hi! I'm having an issue with the react TDD, I receive a CORS error when axios makes the request from my localhost:3000, I've tried adding allow origin header and still the same, how can I Solve this? great explanaition of TDD!!
    Josh Justice
    @CodingItWrong
    Hi, sorry about that. I change the API recently. I should be able to look at getting that corrected tonight.
    Josh Justice
    @CodingItWrong
    @elov:matrix.org OK, I was able to reproduce the error. I got a fix in and it is working for me now. Please retry and if it still gives you issues, let me know
    3 replies
    Chris Scott
    @manach
    @CodingItWrong thanks for an amazing tutorial Josh. I spent three days and 15+ hours looking for a good frontend TDD tutorial, including paid and free resources, and finally found yours. It's the best of its kind and I can't believe you're not a full-time technical writer. Incredible work. Thank you!
    CrispyCB
    @CrispyCB_gitlab
    @CodingItWrong Echoing the praise + thanks. Really well done. Are there any plans to upgrade to Cypress 7?
    Tim Fleming
    @tflem
    @CodingItWrong Echoing praise as well. Enjoying it so far!
    Josh Justice
    @CodingItWrong
    Thanks folks, I'm really glad it's helpful! @manach I actually work at Big Nerd Ranch, who publishes books, and although I'm not an author there, I've gotten a lot of good editing on my blog posts that I guess has paid off :-)
    @CrispyCB_gitlab That's a great idea; I think I'll prioritize updating the React exercise to Cypress 7. For Vue, I'll check and see if Vue CLI uses Cypress 7 yet.
    Thanks for the suggestion! That'll help a lot of folks.
    Josh Justice
    @CodingItWrong
    Update on this: I've decided to stick with the older cy.route() API although it's deprecated in Cypress 7. I made the same decision on a production project. Rationale added to the web site. If y'all know of any other Cypress 7 differences that would affect the tutorial, feel free to let me know!
    alexandercyr
    @alexandercyr
    Wondering if there's something I'm missing...I made it to end of 'Unit Testing the Store' and tests aren't passing. Redux tests are passing fine, but unit tests are failing now for RestaurantList component.
    Error: Uncaught [Error: Could not find "store" in the context of "Connect(RestaurantsList)". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(RestaurantsList) in connect options.]
    App.js has the Provider with store, so I'm not sure where the issue is. Wondering if this is a common issue or not
    Josh Justice
    @CodingItWrong
    @alexandercyr make sure you did a named import import {RestaurantList} in the test file, rather than the default import import RestaurantList
    alexandercyr
    @alexandercyr
    @CodingItWrong that did the trick! 🙌appreciate the help
    Josh Justice
    @CodingItWrong
    Great! I'll see if I can add a clear warning at that spot. What was going on is, the named export is the non-Redux-connected component, which the test expects. The default export is the Redux-connected component. For that one to work in the test, Redux setup would be needed in the test itself: that was what the error message you were getting was. Redux setup in App.JS doesn't carry over into the tests.
    Andres Manz
    @andresmanz
    Hey, I can't access the guide anymore (NET::ERR_CERT_DATE_INVALID). Very nice guide so far, would love to read on.
    Josh Justice
    @CodingItWrong
    @andresmanz Sorry about that. I just tried and saw the error too. I made a change and it appears to be fixed for me now; please give it a try and let me know whether or not you're still getting the error.
    Andres Manz
    @andresmanz
    That was quick, thank you very much!
    Josh Justice
    @CodingItWrong
    sure thing!
    Sean Dickinson
    @atinybeardedman
    I'm wondering is there a way for us to give feedback on an error in the guide? I'm going through the Vue version and there's a missing step to get it to run without errors
    I'm not sure if it's a change in the way vuetify works but once I started trying to add the v-alert component it wouldn't mount correctly in the tests. You have to instantiate a new instance of vuetify in the mount options. So it has to be wrapper = mount(RestaurantList, {localVue, store, vuetify: new Vuetify()});
    otherwise you get a really unhelpful error and the whole test suite fails
    weirdly it's fine initially, only the v-alert component caused the issue
    Josh Justice
    @CodingItWrong
    Thanks @atinybeardedman, I'll see if I can replicate that error and confirm the fix, then add it in
    Josh Justice
    @CodingItWrong
    @atinybeardedman could you post your repo in the state where it's giving the error somewhere public to help me replicate it locally?
    Jim Strother
    @jstrother
    I am in Chapter 3 in the "Stepping Down to a Unit Test" section and the final refactor is giving me fits. Before I made and used the findByTestId function, all tests were passing. After that function, it's telling me TypeError: Cannot read property 'text' of undefined. Here is the repo, if somebody has a chance to take a look at the code: https://github.com/jstrother/opinion-ate/tree/list-restaurants
    Thanks in advance!
    Josh Justice
    @CodingItWrong
    @jstrother OK, I checked it out. What's going on is that your findByTestId() function isn't returning a value. If you add a return keyword in front of it, it passes: return wrapper.findAll…". The example in the code doesn't have curly braces around the function, so it's the "expression" form of an arrow function that automatically returns the value without the "return" keyword
    Jim Strother
    @jstrother
    @CodingItWrong oh geez. I can't believe i did that. I feel like such a goof. 🤦‍♂️
    Thanks for the assist.
    Josh Justice
    @CodingItWrong
    @jstrother no worries, i'm 99% sure i've done that on client work in the last week =]
    Josh Justice
    @CodingItWrong
    @atinybeardedman ignore my previous request; i got caught back up in the code and am getting the v-alert error now; fixing
    Josh Justice
    @CodingItWrong
    Screen Shot 2021-05-06 at 8.28.37 AM.png
    Screen Shot 2021-05-06 at 8.28.55 AM.png
    @atinybeardedman alright, docs updated, see above. i'm going to run through the rest of the vue tutorial to ensure there aren't any other errors related to this that need to be fixed. thanks again for raising the issue!
    Sean Dickinson
    @atinybeardedman
    @CodingItWrong awesome, thanks for the quick response. Sorry I didn't see your message earlier about posting my repo
    technoplato
    @technoplato
    Hey @CodingItWrong Im building a hobby project with the intent of laying a very solid architecture and am having a hard time wrapping my head around testing things like my repositories, data sources, services, use cases, etc and I was wondering if you had any experience or recommendations for where you’d look for examples or guidance. There’s lots of Uncle Bob type code but not many walkthroughs on writing useful tests for clean architecture. Thanks in advance for any suggestions.
    Josh Justice
    @CodingItWrong
    @technoplato great question. I'm familiar with clean architecture, and it is supposed to make testing easier. But I don't know of any example code to point to. If you want to put some sample code up in a gist or repo, I'd be happy to share thoughts on testing it.
    technoplato
    @technoplato

    Thats very generous of you thank you. At the moment, ive realized im going to need to create an abstract pattern (repository? usecase?) thats look at to see if ive already saved an entity to my database, and if not, fetch it from an external API (youtube, spotify, etc)

    I can post the code, but im also still trying to learn about the best pattern for the above, as ive currently just performed that pattern once but i believe ill have to do that repeatedly. Talk soon!

    Eric
    @ericledonge
    Hello @CodingItWrong, in the React exercise, by the end of the chapter 3 - Vertical Slice, my component unit tests are failing:
    Could not find "store" in the context of "Connect(RestaurantList)". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(RestaurantList) in connect options.
    Did I miss something in this chapter, please?
    I more used to work with hooks and frameworks like Rematch, so I can't see easily the solution.
    Josh Justice
    @CodingItWrong

    @ericledonge that error usually occurs when importing the default export into the test. Check to see if you're using the named export, in curlies:

    import {RestaurantList} from '../RestaurantList';

    The default export is connected to Redux so requires a provider. The named export isn't connected to Redux so should work in the test