Unit testing in JavaScript Part 6 — Red, Green, Refactor and Jest mocks

Mattias Petter Johansson
Fun Fun Function
Published in
1 min readDec 18, 2017

Today, we are continuing our journey on unit testing in JavaScript. In this episode we do some refactoring, and change our tests to use Jest mock helpers instead of our custom mocks written in vanilla JavaScript.

Full video below:

💖 Survey: Please tell me your opinion on this episode
https://funfunfunction.typeform.com/to/sUvfTW?ep=unte6

🔗 Support the show by becoming a Patreon
https://www.patreon.com/funfunfunction

🔗 Watch this series from the start
https://www.youtube.com/watch?v=Eu35xM76kKY&index=1&list=PL0zVEGEvSaeF_zoW9o66wa_UCNE3a7BEr

🔗 Discuss this video on the Fun Fun Forum
https://www.funfunforum.com/t/unit-testing-in-javascript-part-6-red-green-refactor-and-jest-mocks/3480

🔗 Code from the episode
https://github.com/mpj/unit-testing-series/tree/58fd83c3c5be4243c9d0f19a840aae9a6ef4ef86

🔗 That cool inline evaluation plugin
https://quokkajs.com/

🔗 mpj on Twitter
https://twitter.com/mpjme

🔗 The gear I use to produce the videos
https://youtu.be/gTk8nPj11Yk

🔗 Help translate the show to your language
http://www.youtube.com/timedtext_cs_panel?tab=2&c=UCO1cgjhGzsSYb1rsB4bFe4Q

--

--

Mattias Petter Johansson
Fun Fun Function

Creator of Fun Fun Function, a YouTube show about programming.