JavaScript Jabber

JSJ 411: Unit Testing Jest with Daniel Caldas


Listen Later

Daniel Caldas is calling from Singapore. He currently works as a software engineer for Zendesk and has also worked in Portugal and Germany. He has worked primarily on the frontend with Node and JavaScript. He talks about his experience testing JavaScript, how he got started with Jest, and why he likes it. Daniel finds Jest very easy to use and straightforward. He likes that  Jest has a single reference page for documentation. He feels that Jest is largely complete out of the box and has only made a small add on to get rid of Boilerplate in some tests.Daniel explains what a snapshot, how they work, and why he prefers fixtures over factories. He gives tips on how to set up your tests so that they are easy to follow. He finds it helps to structure your scenarios in the fixture description. He talks about gotchas in Jest. While Jest is largely easy to use, Jest has been around for a while and breaking changes do happen. It’s important to check what version your code base is using. While there are a lot of free sources around Jest online, he advises listeners to stick as close to the official documentation as possible, or to people associated with Jest, and to read recent stuff. As for conventions, Jest has pretty much everything out of the box and the built in conventions make it easy to navigate any project that uses Jest.Daniel talks about some of the features available in Jest, converting observables into promises, and tricks he has used to make tests easier to put together. He talks about his method for keeping his mocks and stubs straight. He advises listeners to have some organizational rules, such as starting the imports alphabetically, and to always follow those rules. He talks about how he runs tests and what environments he uses. While Jest is normally used for unit testing, Daniel has also used it for end to end tests, and he talks about his experience with an open source project doing both types in Jest. Daniel concludes the show by advising listeners starting with JavaScript and frontend, don’t think too much about the library you’re going to use because you’ll probably end up using Jest. It’s more important to have unit tests and a proper testing framework at the beginning than anything else. He also invites listeners to check out his open source work on Github.Panelists
  • Aimee Knight
  • AJ O’Neal
  • Charles Max Wood
 **To receive your 40% OFF coupon for Manning Publications (good for all our products in all formats) visit us on Facebook - click on "Send A Message"and type "YES"**Guest
  • Danile Caldas
Sponsors
  • Sentry | Use the code “devchat” for $100 credit
Links
  • Zendesk
  • Jest
  • React
  • Babel
  • ESLint
  • Async/Await
  • Cypress
  • React-d3-graph
  • Unrevealed tips for unit testing with Jest
PicksAimee Knight:
  • The Difference Between Fault Tolerance, High Availability, and Disaster Recovery
AJ O’Neal:
  • Rubin Report with Lindsay Shepherd
Charles Max Wood:
  • White Christmas
  • Holiday Inn
Daniel Caldas:
  • Home Alone
Special Guest: Daniel Caldas.

Support this podcast at — https://redcircle.com/javascript-jabber/donations

Privacy & Opt-Out: https://redcircle.com/privacy

Become a supporter of this podcast: https://www.spreaker.com/podcast/javascript-jabber--6102064/support.
...more
View all episodesView all episodes
Download on the App Store

JavaScript JabberBy Charles M Wood

  • 3.8
  • 3.8
  • 3.8
  • 3.8
  • 3.8

3.8

62 ratings


More shows like JavaScript Jabber

View all
Software Engineering Radio - the podcast for professional software developers by team@se-radio.net (SE-Radio Team)

Software Engineering Radio - the podcast for professional software developers

273 Listeners

Hanselminutes with Scott Hanselman by Scott Hanselman

Hanselminutes with Scott Hanselman

382 Listeners

The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

288 Listeners

Ruby Rogues by Charles M Wood

Ruby Rogues

45 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

626 Listeners

Adventures in Angular by Charles M Wood

Adventures in Angular

33 Listeners

JavaScript Jabber by Charles M Wood

JavaScript Jabber

234 Listeners

Talk Python To Me by Michael Kennedy

Talk Python To Me

583 Listeners

Soft Skills Engineering by Jamison Dance and Dave Smith

Soft Skills Engineering

287 Listeners

iPhreaks by Charles M Wood

iPhreaks

17 Listeners

React Native Radio by Jamon Holmgren, Robin Heinze, Mazen Chami

React Native Radio

67 Listeners

Python Bytes by Michael Kennedy and Brian Okken

Python Bytes

214 Listeners

Adventures in Angular by Charles M Wood

Adventures in Angular

15 Listeners

Ruby Rogues by Charles M Wood

Ruby Rogues

21 Listeners

My Angular Story by Charles M Wood

My Angular Story

0 Listeners

My Ruby Story by Charles M Wood

My Ruby Story

0 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

985 Listeners

The freeCodeCamp Podcast by freeCodeCamp.org

The freeCodeCamp Podcast

485 Listeners

Practical AI by Practical AI LLC

Practical AI

212 Listeners

AWS Podcast by Amazon Web Services

AWS Podcast

204 Listeners

.NET Rocks! by Carl Franklin and Richard Campbell

.NET Rocks!

242 Listeners

The Stack Overflow Podcast by The Stack Overflow Podcast

The Stack Overflow Podcast

63 Listeners

The Real Python Podcast by Real Python

The Real Python Podcast

140 Listeners

Latent Space: The AI Engineer Podcast by Latent.Space

Latent Space: The AI Engineer Podcast

101 Listeners