JSON Server to Mock API Servers: A Quick and Easy Solution

Todd Leininger Development Technologies, JavaScript, Testing, Tutorial Leave a Comment

I have found myself in the following scenario many times throughout my career. Everyone is ready to get the project started. You know what you are going to be working on, and as the frontend developer, you get started right away. You get to the point that you are ready to test your code to see how the API calls work. There’s one major thing in your way, though. The APIs aren’t done yet.

You could just create some static JSON files and read them in, but that doesn’t really test out calling an API. That’s where JSON Server swoops in to save the day. In this post, I’ll walk through how to use JSON Server. We’ll set up our environment, serve a simple JSON file, and generate mock data.

Cook Your Own Modal with Styled Components

Lou Mauget Development Technologies, JavaScript, React, Tutorial Leave a Comment

I created several JavaScript modal dialogs – I always extend a framework modal instead of scratch-coding my own. I thought I knew the things a framework needs to implement in order to present a modal but did I? There was only one way to find out: cook my own JS browser modal, and that is exactly what we’ll do in this post.

In this blog, I’ll cover a short approach to hand-coding your own modal with Styled Components. You can find the entire project on GitHub.

Using Jest and Testing Library with React Native Part III: Element Not Found

Justin Leach Development Technologies, JavaScript, React Native, Testing, Testing React Native Series, Tutorial Leave a Comment

In the last installment (Part II), we walked through creating and executing our very first test. With that out of the way, let’s move on to something slightly more complicated. Elements that cannot be found typically are elements that are initially hidden. In this post, we’ll cover how to test for an element or component that isn’t found.