$30 off During Our Annual Pro Sale. View Details »

Snapshot Everything

Snapshot Everything

A brief introduction to the magic of "snapshot testing" (it's not just for the front-end)

Given at Brooklyn JS in 2017

Jason Rhodes

May 18, 2017
Tweet

More Decks by Jason Rhodes

Other Decks in Programming

Transcript

  1. SNAPSHOT E V E R Y T H I N

    G
  2. [ BKJS SLIDE TEST ] (on the ceiling?) (unseeable)

  3. None
  4. We do email stuff.

  5. Falun Copper Mine Sweden, 1817

  6. None
  7. None
  8. None
  9. None
  10. 2017 SELENIUM SURVEY LOVE SELENIUM DON’T LOVE SELENIUM DON’T NOT

    LIKE SELENIUM
  11. We use Selenium. We have a fuckton of tests.

  12. None
  13. …the whole point of tests is to gain confidence before

    changing things. And to the extent that there are false negatives in the tests, or the tests gum up the works, they’re doing the opposite of that. Tests are one way to gain some confidence that a change is safe. But that’s all they are. Just one way. –Dan McKinley, Former Etsy Engineer Source: pushtrain.club
  14. The whole point of tests is to gain confidence before

    changing things. Tests are one way to gain some confidence that a change is safe. Source: Dan McKinley’s awesome slide deck at http://pushtrain.club
  15. snapshot tests!

  16. snapshot tests?

  17. None
  18. None
  19. None
  20. None
  21. None
  22. None
  23. None
  24. snapshot tests!

  25. Easy to write Run fast Fail fast With helpful diffs

  26. >1200 functional tests in our various API services

  27. None
  28. None
  29. None
  30. None
  31. None
  32. None
  33. None
  34. None
  35. None
  36. None
  37. None
  38. None
  39. None
  40. None
  41. None
  42. None
  43. @rhodesjason ſ rhodesjason $ npm install ohsnap

  44. Thanks! @rhodesjason ſ rhodesjason $ npm install ohsnap