~/talk

Mocking in Front-end and Back-end TypeScript Tests

Talkat NDC Porto 2022 · 2022-04-25..04-29· [typescript, testing]
slides:none on file

A simple game app with a Redis-backed leaderboard gets unit, integration and e2e tests that mock only what’s needed: import-level functions and Express request/response objects while leaving Vue components mountable. Uses ts-auto-mock to fill Partial<T> objects and ts-mock-imports to replace module imports, runs tests with Jest and Cypress, and fakes Redis in unit runs. Test run shows 8 server tests, 19 unit component tests and 6 end-to-end tests all passing.

AI-written summary · about

  1. 0:00Start
  2. 3:33Testing Browser Apps
  3. 8:14The Problem
  4. 12:14Monkey Patching
  5. 44:37Mocking in TypeScript
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.