Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Josh Justice
    @CodingItWrong
    Welcome, everyone! This is Josh, the author of Outside-In Frontend Dev. I'm looking forward to hear any questions or feedback you have about the guide!
    Kristian Ivanov
    @KristianWEB7_twitter

    Hey, thanks again for your work! I really appreciate it as a beginner in the TDD community.
    I'm currently going through the guide and if I find a typo I will let you know :)

    https://outsidein.dev/outside-in-tdd.html#beyond-traditional-tdd ( Finally, building from the middle out can result in can result in building functionality that is unused or difficult to use. )

    Josh Justice
    @CodingItWrong
    Sure thing, thanks for sending any corrections over!
    Josh Justice
    @CodingItWrong
    @KristianWEB7_twitter I got that fixed btw, thanks
    Kristian Ivanov
    @KristianWEB7_twitter
    @CodingItWrong I'm almost done with the tutorial and I can tell that I've learned a lot on how to approach testing from this day on. However currently in my situation I'm working mostly with GraphQL architectures ( especially ApolloGraphQL ) where the data and components are mostly driven by queries/mutations which is quite different from REST/Redux. Do you have anything in mind about working on a GraphQL TDD Frontend book ( or if you have any resources that would be fantastic ) ? I know that a lot of the principles apply to it but in my opinion there's something to be taught in there as well. Thanks again for your work for the sake of learning!
    Josh Justice
    @CodingItWrong

    @KristianWEB7_twitter that's a good question! I haven't worked extensively with GraphQL so I wouldn't be the best one to write extensively on it. As you work with it, I'd encourage you to blog about TDD approaches that you discover!

    I think the key principle that applies is to isolate your application code from the third-party code, in this case the GraphQL library. An example is how the book's component tests don't know about Redux. You can do the same thing with a GraphQL library by creating a "dumb" component that receives plain props that you test, and a parent "connected" component that connects to your GraphQL library. This kind of works against how React hooks work by default, but it's common to need to separate concerns for testability like that.

    As for testing your GraphQL code, for simple queries, I might not unit test them at all: that's just configuration. Your E2E Test will cover that. When you have logic (like, updating a local cache after you save a record to the server), there are two approaches you can investigate: (1) testing your code in isolation from the library, which might mean extracting a stand-alone function you can test directly, or (2) testing your code in integration from the GraphQL library, which would involve finding the simplest way you can configure and send commands to the library from within a test.

    Those principles should help you have direction no matter what kind of code you're looking to test in the future.

    Tatiana
    @theory-of-soul

    Hi! Thanks a lot for your guide.
    I just want to add that don't need to install eslint in this step https://outsidein.dev/react/2-project-setup.html#setting-up-autoformatting

    Right now it makes some troubles with eslint versions (v 6.6 vs v. 7)

    The react-scripts package provided by Create React App requires a dependency:
    "eslint": "^6.6.0"

    Josh Justice
    @CodingItWrong
    @theory-of-soul sorry for the delay replying! Thanks for the correction, I'll update it later today
    alireza-chassebi
    @alireza-chassebi
    hey i just started following ur react tdd guide and when i try to run the smoke test i get this error
    fs.existsSync is not a function
    in one of the node_modules in CRA specifically node_modules/global-dirs/index.js line 68
    Josh Justice
    @CodingItWrong
    @alireza-chassebi I made a note to try that out today or tomorrow to see if I can find a fix. In the meantime, (1) you may want to check CRA github issues or Stack Overflow for this error, and (2) if you can push up your code that has the error to a public repo, that will help be troubleshoot
    alireza-chassebi
    @alireza-chassebi
    i will take a look but so far I have had no luck
    appreciate the help
    Josh Justice
    @CodingItWrong
    👍
    Thanks for checking out the guide! I'll do my best to get you up and running
    One more option is Reactiflux, the React Discord server. Someone there might also have ideas
    Josh Justice
    @CodingItWrong
    @alireza-chassebi I pulled down your repo and was able to see the error as well. Two options for you:
    1. I just created a repo that does work for me locally that you're welcome to use as the basis for yours: https://github.com/CodingItWrong/opinion-ate-temp - Something about the steps I followed was different. It looks like you're using npm, whereas I'm using yarn, and CRA hooks in to one or the other initially. But I switched over to npm and the package-lock.json file, and it still succeeds for me.
    2. The error seems to be coming from Cypress, so you could open an issue for them on their GitHub repo, and give them a link to your project repo: https://github.com/cypress-io/cypress/issues
    alireza-chassebi
    @alireza-chassebi
    thanks ill try it i was initially using yarn and it didnt work so i tried it with npm and it still did not work
    :) thanks for the help
    NRVIII
    @NRVIII
    hi! really enjoying the approach of TDD. Stopped at api => page is returning a HTTP 502
    any help?
    NRVIII
    @NRVIII
    just created a server in express to learn :thumbsup:
    Josh Justice
    @CodingItWrong
    @NRVIII Sorry for that error; the address of the API has changed and I forgot to update it on the site. It's been corrected now. The address is https://outside-in-dev-api.herokuapp.com/ - I've confirmed that it's working for me there now
    NRVIII
    @NRVIII
    thx for your help! Just a feedback, but the heroku is not working for me . Maybe because I am from Brazil? When enter put the site starts an infinite loading and presents the message "This page is not working"...
    Josh Justice
    @CodingItWrong
    Sorry, I'm not sure. This site reports that the API is up, so it might just be you: https://downforeveryoneorjustme.com/outside-in-dev-api.herokuapp.com
    NRVIII
    @NRVIII
    image.png
    for me is down, maybe is locked by region
    Josh Justice
    @CodingItWrong
    @NRVIII Ok, I tried adjusting a setting on the servers, so its possible it will work now. That monitoring site is showing success for me again
    NRVIII
    @NRVIII
    image.png
    working!!! Thanks for your help!! And indeed, for this incredible course!
    Josh Justice
    @CodingItWrong
    You're very welcome. Thanks for letting me know so I could fix up the server for others too
    NRVIII
    @NRVIII

    You're very welcome. Thanks for letting me know so I could fix up the server for others too

    :thumbsup: :thumbsup:

    Bernard Amofah
    @bamofah

    hi first of thanks for the great tutorial. I am having some issues from the gat ego. when i try and run yarn cypress i get the following
    Cypress could not verify that this server is running:

    http://localhost:3000

    This server has been configured as your baseUrl, and tests will likely fail if it is not running.

    I get this when running on wsl but on windows I get the following errors

    Cypress failed to start.

    This is usually caused by a missing library or dependency.

    The error below should indicate which dependency is missing.

    https://on.cypress.io/required-dependencies

    If you are using Docker, we provide containers with all required dependencies installed.

    Would greatly appreciate your assistance

    image.png
    Josh Justice
    @CodingItWrong
    @bamofah Sorry you're running into errors! For the error about http://localhost:3000 not running: if you visit http://localhost:3000 in a browser, does it work? If not, make sure to run your application using yarn start for the React exercises or yarn serve for the Vue exercises.
    If that doesn't help, I'd recommend asking on the Cypress Gitter: https://gitter.im/cypress-io/cypress