~/talk

Testing React Applications

Talkat Assert(js) 2018 · on Thursday, 2018-02-22· [testing, react]
name:Mary Snow
github:Mary-Snow
slides:none on file

Project adds tests to a React app using Jest, Enzyme and JSDOM and shows concrete patterns that work. Unit tests use shallow to assert a counter starts at 1 and that simulate('click') calls the onClick prop to make it 2. Full rendering uses mount to exercise lifecycle methods and verify componentDidMount spies run once; beware shared DOM and unmount between tests. Static output uses render/cheerio and Jest snapshots that fail on change and update with the U key.

AI-written summary · about

  1. 0:00Introduction
  2. 0:25Why Testing
  3. 1:00Benefits of Testing
  4. 1:45What is React
  5. 3:29Shallow Mount
  6. 3:53Component Output
  7. 5:16Props
  8. 5:26Wrapper Props
  9. 6:28Mount
  10. 6:45Lifecycle Methods
  11. 7:30Render Render
  12. 8:02Snapshots
  13. 8:56Snapshot Limitations
  14. 9:20Snapshot Failure
  15. 9:32Update Snapshot
  16. 9:49Summary
~/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.