JSJ 411: Unit Testing Jest with Daniel Caldas

JSJ 411: Unit Testing Jest with Daniel Caldas

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
LinksPicksAimee Knight:AJ O’Neal:Charles Max Wood:Daniel Caldas: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.

Episoder(737)

057 JSJ Functional Programming with Zach Kessin

057 JSJ Functional Programming with Zach Kessin

Use this link and code JAVAJAB to get 20% off your registration for FluentConf 2013!PanelZachary Kessin (twitter github Mostly Erlang Podcast) Jamison Dance (twitter github blog) Merrick Christensen (...

2 Mai 201343min

056 JSJ Marionette.js with Derick Bailey

056 JSJ Marionette.js with Derick Bailey

Use this link and code JAVAJAB to get 20% off your registration for FluentConf 2013!PanelDerick Bailey (twitter github blog) AJ O’Neal (twitter github blog) Merrick Christensen (twitter github) Joe Ea...

19 Apr 20131h 1min

055 JSJ Web Developer Skills

055 JSJ Web Developer Skills

Use this link and code JAVAJAB to get 20% off your registration for FluentConf 2013! Panel AJ O’Neal (twitter github blog) Merrick Christensen (twitter github) Joe Eames (twitter github blog) Jamison...

12 Apr 201339min

054 JSJ JavaScript Parsing, ASTs, and Language Grammar w/ David Herman and Ariya Hidayat

054 JSJ JavaScript Parsing, ASTs, and Language Grammar w/ David Herman and Ariya Hidayat

Use this link and code JAVAJAB to get 20% off your registration for FluentConf 2013!PanelDavid Herman (twitter blog Effective JavaScript) Ariya Hidayat (twitter github blog) Tim Caswell (twitter githu...

5 Apr 201359min

053 JSJ Software Team Dynamics

053 JSJ Software Team Dynamics

Use this link and code JAVAJAB to get 20% off your registration for FluentConf 2013! PanelJoe Eames (twitter github blog) Jamison Dance (twitter github blog) AJ O’Neal (twitter github blog) Merrick Ch...

29 Mar 201346min

052 JSJ Node & NPM with Isaac Schlueter

052 JSJ Node & NPM with Isaac Schlueter

Use this link and code JAVAJAB to get 20% off your registration for FluentConf 2013! PanelIsaac Schlueter (twitter github blog) Joe Eames (twitter github blog) Merrick Christensen (twitter github) AJ ...

22 Mar 20131h

051 JSJ Finding a Job

051 JSJ Finding a Job

PanelAJ O’Neal (twitter github blog) Jamison Dance (twitter github blog) Charles Max Wood (twitter github Teach Me To Code Rails Ramp Up) Discussion 01:02 - Panelist employment backgrounds04:34 - Prog...

15 Mar 201352min

050 JSJ QUnit with Jörn Zaefferer

050 JSJ QUnit with Jörn Zaefferer

Panel Jörn Zaefferer (twitter github blog) Jamison Dance (twitter github blog) Joe Eames (twitter github blog) Charles Max Wood (twitter github Teach Me To Code Rails Ramp Up) Discussion 01:15 - Jörn ...

8 Mar 201333min

Populært innen Business og økonomi

stopp-verden
lydartikler-fra-aftenposten
dine-penger-pengeradet
e24-podden
rss-penger-polser-og-politikk
rss-borsmorgen-okonominyhetene
utbytte
pengesnakk
finansredaksjonen
pengepodden-2
tid-er-penger-en-podcast-med-peter-warren
rss-sunn-okonomi
morgenkaffen-med-finansavisen
livet-pa-veien-med-jan-erik-larssen
lederpodden
rss-markedspuls-2
okonomiamatorene
rss-andelige-tanker-med-camillo
stormkast-med-valebrokk-stordalen
rss-fa-makro