The yargs library is my preferred library to implement a CLI. One of the challenges I've come across with yargs is figuring out how to write unit tests using Jest. Let me show you the pattern that I've started to use to test my commands.
👋 I'm Kishan, a software engineer.
Welcome to my development playground.
I've found Docusaurus to be a great tool for both documentation sites as well as blogs because it provides great functionality out of the box and lets you focus on your site's content. I'm in the process of migrating a few sites over to it. A common feature for the sites I'm building is to display a list of recent blog posts on the home page. Unfortunately, there isn't a straight forward path to do this.
In a previous post, I showed how to integrate Contentful into an Angular project using their REST API. Now that Contentful's GraphQL API is available in the community edition, it should be the preferred way to build your front-end and I'll show you why. This is an example of how to use Contentful to store blog posts, and create a front-end using Angular that will access the data using the GraphQL API.
I'm starting to write end-to-end tests for Angular Universal apps that are a front-end for a headless CMS. My goals are to test the basic functionalities of server-side rendering (SSR), run accessibility tests, and check if any errors are logged to the browser's console. I've seen many questions about how to test Angular Universal apps, so I wanted to share my setup.
After deploying an Angular SSR app, you might come to notice it takes a few seconds to load the initial page. The time it takes for the Universal engine to render the view is one of many factors that contribute to this delay. Let's see how caching the rendered HTML can improve load times for subsequent requests.