Skip to main content
CodeOath

Front-end and full stack · Chapter 17

Jest, continued: mocks, spies and asynchronous tests

See how Jest mocks and spies replace what sits outside the code, when mocking proves nothing, and how to test asynchronous code and timers.

In this chapter

  1. Code that talks to the outside
  2. Mock functions
  3. Spies: watch the real thing
  4. When mocking stops testing anything
  5. Asynchronous tests
  6. Fake timers
  7. Mistakes that recur

Locked: needs a plan

You can read chapter 1 free. Chapter 17 is the next one.

What you can do now, free: re-read chapter 1 and try its problems.

What a plan gives you: all chapters of the track you pick and their checks. Professional, one role is ₹329 a month or ₹2,299 a year. It renews until you cancel, and you can cancel any time. Paid plans open at launch.

Why is this locked?

Chapter 1 of every track is free, so you can see how the track reads. The rest of a track and its checks come with a plan, or open as you pass each chapter's check.

The price is for one period, a month or a year. A plan renews until you cancel.

Back to the track