RM

  • Blog

Category: JS - Page 2

Tool we love - formbear.io

Ship Forms in 60 Seconds

Stop building form backends. Perfect for MVPs & validating ideas.

Adding Google AdSense to Gatsby website

Adding Google AdSense to Gatsby Website

Last Updated: July 27, 2023

Adding Google AdSense to a Gatsby Website. Lazy load the Google AdSense script to keep site speed fast. Examples and walk through in article.

ES6 Modules for beginners

ES6 Modules: A Beginner’s Guide

Last Updated: July 14, 2022

Why would you use ES6 modules in JavaScript? How to import and export ES6 modules? This article is the beginners guide to ES6 Modules.

Mock ES6 Module in Jest

How to Mock an ES6 Module Import using Jest

Last Updated: November 21, 2022

How to mock es6 modules? Solution for how ES6 modules can be mocked in Jest unit tests. Mocking es6 modules with Jest.

Mocking date in Redux Toolkit unit tests jest

How to Mock the Date in Redux Toolkit

Last Updated: July 27, 2023

Mocking date in Redux Toolkit slice with jest in unit tests solution. How to solve new date isostring issue in RTK mock.

Arrange Act Assert Unit Test

Arrange, Act and Assert Pattern: The Three A’s of Unit Testing

Last Updated: December 14, 2022

How to use Arrange Act Assert pattern in unit testing, and why it is so helpful. Arrange-Act-Assert is powerful because it is simple. By keeping the tests short and concise means clean tests.

Testing images in React with Jest

Test Images in React with Jest

Last Updated: November 21, 2022

Solution for testing that images have rendered in React using Jest. And how to test an image alt and src in jest using React. Including example code.

NextJS and WordPress Shortcodes

Using WordPress Shortcodes with Next JS

Last Updated: July 27, 2023

Solution to using WordPress shortcodes in NextJS. Replace WordPress shortcode with React Component in NextJS simply.

Mocking A React Component In Jest

How To Mock A React Component In Jest

Last Updated: December 1, 2022

How to mock a React component in a jest unit test. Example of how to mock a default or named component using React Testing Library.

Use Within to Test in React Testing Library

How to Query and Test Within a Specific Component in Jest

Last Updated: November 21, 2022

Examples of how to use within in Jest and React Testing Library to target a specific section of the component. Restrict Jest queries to a particular element. Inside the context of a DOM node.

MUI DatePicker Localization date-fns locale

Dynamically import date-fns locale files for MUI DatePicker localization

Last Updated: July 27, 2023

Using React MUI DatePicker dynamically lazy load date-fns locale files for localization. Reduce page size, speed up load time. Full working example and how to solution. Import locale files from date-fns.

Shortcodes from WordPress in Gatsby

Using WordPress Shortcode Functionality in Gatsby

Last Updated: July 27, 2023

Solution to using WordPress shortcodes in Gatsby. Replace WordPress shortcode with React Component in Gatsby simply. No MDX needed.

Unit testing localizations for React app

Unit Testing Localizations in React App. Solution for Mocking Intl API

Last Updated: September 29, 2022

Solution for error 'RangeError: timeZone is not supported.' when unit testing Intl API. Caused by Node not supporting time zones

  • Prev Page (1)
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Next Page (3)

Helpful Bits Straight Into Your Inbox

Subscribe to the newsletter for insights and helpful pieces on React, Next JS, Headless WordPress, and modern web development.

Powered ByFormBear
By Robert Marshall