Category: javascript

Photo by Kellen Riggin from Unsplash

Test the Theme toggle app using react-testing-library

In my previous article we’ve built an app with Theme toggling capability. In this article, let’s test that feature. I’ll be using react-testing-library and jest-dom as a partner library for the react-testing-library for leveraging custom DOM element matchers for Jest. Let’s install both the libraries as dev dependencies. npm install -D react-testing-library jest-dom Since we used create-react-app, there is a […] read more
React Context Demo

Toggle theme using React Hooks

I was trying to implement the Dark mode to one of the application which I was working. Most of the examples available in Internet uses either styled-components or any other css-in-js concepts. The application which I’m working on doesn’t have the css-in-js yet. So I want to keep it very simple. Hence, the very first thing that came up is […] read more

Deploying GraphQL Server on Heroku

Today, I’ll show you on how to deploy a simple Graphql server on Heroku. I’m considering the following stack to show my example: Mongo (using mongoose) Express GraphQL (using apollo-server) NodeJS server A sample GraphQL server look like this: View the code on Gist. I have one Mutation which is used to add an user to the mongo collection and […] read more

Test Automation using NightWatch – Part 1

Nightwatch Examples In this blog series, I’m going to show you what I’ve learned automating using NightwatchJs. A NightwatchJs is an E2E testing framework used for automating browser web apps. It uses the W3C WebDriver API as the underlying to perform automation. It has the built in test runner, which can run the tests even in parallel, by group and […] read more
React bootstrap table example

React bootstrap table – Part 1

Sometime back I came across a library called React Bootstrap Table. This helps you to build the table with loads of features like Pagination, Filtering, Sorting, Export to CSV and many more. And even it allows you to customise as per your need. I’ve explored various grid / table component libraries to use, but many came with difficulty to either […] read more