$chiubaca / notes / fleeting / 2021-04-17
  • Reading more blogs about Jest.
    • 3 ways to mock
    • jest.fn(), used to mock a function
    • jest.mock(), used to mock entire modules
    • jest.spyOn(), used to either watch a function and exposes extra meta data about how, when, times etc a function/method was called
Edit on GitHub ✏️

Hey I'm Alex Chiu 👋. These are my notes for literally anything.

I'm using the Zettelkasten method to organise my thoughts here.

My more polished writings are published to my main blog at chiubaca.com

Follow me on: Github / X (Twitter) / Mastodon / LinkedIn