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. )
@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.
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:
fs.existsSync is not a function
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:
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.
If you are using Docker, we provide containers with all required dependencies installed.
Would greatly appreciate your assistance