The second edition of Mastering React Test-Driven Development is due for publication soon. This edition has a decent amount of new and updated content.
You can pre-order the book via: the Packt website, Amazon US, and Amazon UK.
There was a lot of material that didn’t make the cut, and I’ll post all of that on ReactTDD.com over the next couple of weeks.
What’s changed in this edition?
- All code samples updated for React 18
- Simplified implementation of tests and helpers
- Focus on one expectation per test
- Simplified test framework design
- and others
- New content on test-driving Jest matchers (replacing use of expectation group functions)
- Improved content on BDD and Cucumber
- New content on builder functions
- Module mocks with
jest.mockrather than relying on ES5 module behavior
- Replaced shallow rendering with component mocks
- Replaced use of the Simulate API with plain JSDOM dispatch
- Replaced use of
defaultPropson components with
...testPropsin test suites
- Introduced nested describe blocks for stub scenarios
- Better usage of semantic HTML elements and ARIA attributes
- Re-written chapters on React Router, Redux and Relay
You might notice that there’s no mention of server-side components, which is one of React 18’s headline features. That was intentional. This book continues to focus on helping you improve your automated testing practice. And if you’ve got the fundamentals in place, testing server-side React should be no problem for you.
If you’ve got questions about the new edition, please get in touch via my website.
— Written by Daniel Irvine on August 19, 2022.