JavaScript Jabber

JSJ 411: Unit Testing Jest with Daniel Caldas

Dec 10, 2019
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Jest As An All-In-One Testing Platform

  • Jest bundles testing, assertions, and coverage so you don't mix separate libraries.
  • That centralization speeds onboarding and reduces setup friction for JavaScript projects.
ANECDOTE

Snapshot Testing Changed His Workflow

  • Daniel discovered snapshot testing when moving from Angular to React and found it transformative.
  • Snapshots removed huge inline assertions and simplified verifying component/output changes.
ADVICE

Eliminate Boilerplate With Tables And Fixtures

  • Use Jest's table-driven tests (test.each / it.each) to eliminate repetitive test boilerplate.
  • Prefer fixtures and snapshot outputs for one-to-one input/output mapping instead of complex factories.
Get the Snipd Podcast app to discover more snips from this episode
Get the app