$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

    View Slide

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

    View Slide

  3. View Slide

  4. We do email stuff.

    View Slide

  5. Falun Copper Mine
    Sweden, 1817

    View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. View Slide

  10. 2017 SELENIUM SURVEY
    LOVE SELENIUM
    DON’T LOVE SELENIUM
    DON’T NOT LIKE
    SELENIUM

    View Slide

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

    View Slide

  12. View Slide

  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

    View Slide

  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

    View Slide

  15. snapshot
    tests!

    View Slide

  16. snapshot
    tests?

    View Slide

  17. View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. snapshot
    tests!

    View Slide

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

    View Slide

  26. >1200
    functional tests in our various API services

    View Slide

  27. View Slide

  28. View Slide

  29. View Slide

  30. View Slide

  31. View Slide

  32. View Slide

  33. View Slide

  34. View Slide

  35. View Slide

  36. View Slide

  37. View Slide

  38. View Slide

  39. View Slide

  40. View Slide

  41. View Slide

  42. View Slide

  43. @rhodesjason
    ſ rhodesjason
    $ npm install ohsnap

    View Slide

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

    View Slide