Test-Driven React 2: ToC and description have different test libraries

@TrevorBurnham

Hi everyone,

the book description on pragprog contains the following:

[…] easy-to-understand tests with Vitest and React Testing Library. […]

The table of contents suggest that Jest is being used in the book.

Test-Driven Development with Jest

Was Vitest replaced by Jest or vice versa?

The first chapter uses Jest, but the rest of the book uses Vitest. I know that may feel a little over-complicated, but there’s method to the madness: Jest is the most popular test framework, and it stands on its own, so it’s easy to get up and running. Vitest, on the other hand, is tied to the Vite build system, which I wanted to use for the project that the book develops from Chapter 3 onward.

Vitest is designed to be Jest-compatible, so tests written for one framework will usually run just fine in the other.

I’ll try to make this all clearer in the next revision! Thanks for your feedback.

1 Like

Thanks for the answer :slight_smile:

Would be helpful if you make this clearer but I am happy to hear that you’ll use vitest.

I’ll definitely buy now the book.

I wish you good luck with your book and all upcoming ones.