DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for How To Test Dynamic Lists in React.js (TDD approach)
Marius Espejo
Marius Espejo

Posted on

How To Test Dynamic Lists in React.js (TDD approach)

In my previous posts I covered the basics of how to unit test your React applications as well as how to take a Test-Driven Development approach:

In this next video I show you how to test lists with dynamic content and specific ordering!

We'll again take a test driven development (TDD) approach to first focus on writing the tests, then the implementation.

I also cover strategies to write the code for accessibility as well as various techniques to make it all even better!

Let me know in the comments if you have feedback!

Top comments (2)

Collapse
 
dewaldels profile image
Dewald Els

Thanks for the great content!

Collapse
 
marius profile image
Marius Espejo

thank you I appreciate your comment!

typescript

11 Tips That Make You a Better Typescript Programmer

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!