quackus

quackus

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?

Marked As Solved

TrevorBurnham

TrevorBurnham

Author of Test-Driven React

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.

Where Next?

Popular Pragmatic Bookshelf topics Top

roadbike
From page 13: On Python 3.7, you can install the libraries with pip by running these commands inside a Python venv using Visual Studio ...
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
New
yulkin
your book suggests to use Image.toByteData() to convert image to bytes, however I get the following error: "the getter ‘toByteData’ isn’t...
New
NaplesDave
@mfazio23 I am following along and I have gotten up to adding the data binding items. The project has built alright until I added the da...
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
New
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
herminiotorres
Hi! I know not the intentions behind this narrative when called, on page XI: mount() |> handle_event() |> render() but the correc...
New
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
New
Mmm
Hi, build fails on: bracket-lib = “~0.8.1” when running on Mac Mini M1 Rust version 1.5.0: Compiling winit v0.22.2 error[E0308]: mi...
New
fynn
This is as much a suggestion as a question, as a note for others. Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New

Other popular topics Top

AstonJ
poll poll Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1063 23050 405
New
PragmaticBookshelf
Create efficient, elegant software tests in pytest, Python's most powerful testing framework. Brian Okken @brianokken Edited by Kat...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
PragmaticBookshelf
Tailwind CSS is an exciting new CSS framework that allows you to design your site by composing simple utility classes to create complex e...
New
AstonJ
Or looking forward to? :nerd_face:
503 14742 279
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New

Sub Categories: