Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JestTesting.pdf

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

 JestTesting.pdf

Avatar for Kristi Byrnes

Kristi Byrnes

December 08, 2021
Tweet

More Decks by Kristi Byrnes

Other Decks in Technology

Transcript

  1. SUMMARY • Fundamentals of Testing • Story Time • Automated

    Testing • Types of Tests • What is Jest? • Assertion Library • Test Runner • Writing Meaningful Tests • Testing with Vue • Brand 360 • Show and Tell demo! • Coverage Report
  2. WHAT ARE SOME REASONS FRONT END TESTS ARE IMPORTANT? •

    Confidence! Catch bugs before production! • Save time. • Think about possible issues & bugs. • Breaks up complex dependencies. • Integrated into our build work flow.
  3. TYPES OF TESTS Integration Tests* End-To-End Tests Unit Tests* •

    Smallest piece of code that can be logically isolated in a system • Typically a simple method or function • Fastest • How the units work together • Testing with dependencies, HTTP requests/third parties • Slower than Unit Tests *Indicates that when we test with Jest we are writing Unit and Integration Tests • Tests the user’s journey through the application • Can be a script which executes a certain series of steps • Slowest test
  4. ✔ Jest is both a fast test runner and a

    rich assertion library built in to one ✔ Easy to use, you invoke Jest from the command line ✔ Standard and advanced features: mocking dependencies, snapshots, etc. ✔ Works well with most Single Page Application frameworks out there JEST!
  5. e2e Snapshot Unit • Runs Fast (Unit) • Doesn’t break

    often • Easy to read & understand • Catch BUGS • Provides good coverage