~/talk

Refactoring & Testing (TBD)

TalkinSpanishat JSConf España 2026 · on Saturday, 2026-03-14· [testing]
links:none on file
links:none on file
slides:none on file

A hands-on TypeScript refactor replaces a hardcoded "@mojopi.com" string with a MojopiEmail value object, renames a boolean validate function to isValid and changes execute into a query-like method. The code is updated to use dependency injection so the domain validator is reused instead of being new-ed per call; IDE refactors (inline, introduce parameter, reorder) are applied. Tests are rewritten to avoid brittle boolean expectations—switching to a factory-throw semantics test—and validation stops using exceptions for normal domain rejection.

AI-written summary · about

  1. 0:00Introduction
  2. 1:04TypeScript code smells
  3. 3:00Identifying code issues
  4. 5:09Naming conventions
  5. 8:33Dependency injection testing
  6. 10:02Primitive obsession exceptions
  7. 13:02Refactoring to value objects
  8. 15:15Renaming for clarity
  9. 17:18Creating email value object
  10. 18:45Inline variable refactor
  11. 20:12Parameter introduction
  12. 21:16Removing validator
  13. 23:06Updating tests after refactor
  14. 24:24Domain value objects
  15. 25:52Summary
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.