Book Image

Redux Made Easy with Rematch

By : Sergio Moreno
Book Image

Redux Made Easy with Rematch

By: Sergio Moreno

Overview of this book

Rematch is Redux best practices without the boilerplate. This book is an easy-to-read guide for anyone who wants to get started with Redux, and for those who are already using it and want to improve their codebase. Complete with hands-on tutorials, projects, and self-assessment questions, this easy-to-follow guide will take you from the simplest through to the most complex layers of Rematch. You’ll learn how to migrate from Redux, and write plugins to set up a fully tested store by integrating it with vanilla JavaScript, React, and React Native. You'll then build a real-world application from scratch with the power of Rematch and its plugins. As you advance, you’ll see how plugins extend Rematch functionalities, understanding how they work and help to create a maintainable project. Finally, you'll analyze the future of Rematch and how the frontend ecosystem is becoming easier to use and maintain with alternatives to Redux. By the end of this book, you'll be able to have total control of the application state and use Rematch to manage its scalability with simplicity.
Table of Contents (18 chapters)
1
Section 1: Rematch Essentials
6
Section 2: Building Real-World Web Apps with Rematch
11
Section 3: Diving Deeper into Rematch

Introduction to JavaScript testing

A couple of years ago, JavaScript testing was really obfuscated because no one used to care about testing front-end websites. HTML and CSS were not tested – no one even thought to test it – and JavaScript testing was strange to see. One of the main problems was that a lot of developers were coming from Java, where JUnit introduced everything needed to test an application – a test runner, a library to write the tests, an assertion library – and no equivalents existed for JavaScript.

We had to install three libraries to do something similar for JUnit. That meant that we had to learn how these three libraries worked, and of course there were situations where testing some edge cases was impossible due to incompatibility between libraries.

Let's start understanding how testing now works in JavaScript.

Types of tests

To understand how testing works a bit more and what types of testing exist, I'll try to...