DEV Community

Discussion on: What was your win this week?

Collapse
 
chiangs profile image
Stephen Chiang • Edited

This week, I...

Learned to write better tests for frontend with jest and enzyme and I finished an online course!

heck yeah

Collapse
 
cubiclebuddha profile image
Cubicle Buddha

oh man oh man, I love jest. Have you tried using thevscode-jest plugin yet? It's really great for getting quick feedback. In fact, I even thought about adding a section on vscode-jest to my article on "failing fast" but I had already posted it, and I'm trying to make my blog posts "immutable" haha. The past is the past! :)

Philosophical rambling and linking aside... I'd love to hear what's working for you with jest and what you think could be better. I really like talking about testing. .spyOn is my jam. So much better than having to rely on dependency injection.

Collapse
 
chiangs profile image
Stephen Chiang

Haven't tried it yet; I try to keep light on the extensions, but I'll check it out thanks!

Thread Thread
 
cubiclebuddha profile image
Cubicle Buddha

Yea vscode-jest is definitely not a light extension, but neither is NCrunch which inspired it. But I find that quokka isn’t too bad memory wise.

Collapse
 
engelmav profile image
Vincent Engelmann

awesome! this has been bugging me... (heh, get it!?) for a long time.

Got any quick pointers?

Collapse
 
chiangs profile image
Stephen Chiang

What I think is a really important theme I kept seeing to keep in mind is when writing tests, focus on behavior not implementation.

It makes sense because implementation can change without really breaking the intended behavior of the UI component.