- Update Drawing so that it resets the turtle position when the user clears the screen with the Reset button.
- Our tests have a lot of duplication due to the repeated calls to triggerRequestAnimationFrame. Simplify how this is called by creating a wrapper function called triggerAnimationSequence that takes an array of frame times and calls triggerRequestAnimationFrame for each of those times.
- Loading an existing script (for example, on startup) will take a long time to animate all instructions, and so will pasting in code snippets. How would you modify the system to fast-forward animation in these circumstances?
- How does the undo and redo feature affect animation?

Mastering React Test-Driven Development
By :

Mastering React Test-Driven Development
By:
Overview of this book
Many programmers are aware of TDD but struggle to apply it beyond basic examples. This book teaches how to build complex, real-world applications using Test-Driven Development (TDD). It takes a first principles approach to the TDD process using plain Jest and includes test-driving the integration of libraries including React Router, Redux, and Relay (GraphQL).
Readers will practice systematic refactoring while building out their own test framework, gaining a deep understanding of TDD tools and techniques. They will learn how to test-drive features such as client- and server-side form validation, data filtering and searching, navigation and user workflow, undo/redo, animation, LocalStorage access, WebSocket communication, and querying GraphQL endpoints.
The book covers refactoring codebases to use the React Router and Redux libraries. via TDD. Redux is explored in depth, with reducers, middleware, sagas, and connected React components. The book also covers acceptance testing using Cucumber and Puppeteer.
The book is fully up to date with React 16.9 and has in-depth coverage of hooks and the ‘act’ test helper.
Table of Contents (21 chapters)
Preface
First Steps with Test-Driven Development
Test-driving Data Input with React
Exploring Test Doubles
Creating a User Interface
Section 2: Building a Single-Page Application
Humanizing Forms
Filtering and Searching Data
Test-driving React Router
Test-driving Redux
Test-driving GraphQL
Section 3: Interactivity
Building a Logo Interpreter
Adding Animation
Working with WebSockets
Section 4: Acceptance Testing with BDD
Writing Your First Acceptance Test
Adding Features Guided by Acceptance Tests
Understanding TDD in the Wider Testing Landscape
Other Books You May Enjoy
How would like to rate this book
Customer Reviews