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

Testing JavaScript applications workshop - AmsterdamJS 2018

Testing JavaScript applications workshop - AmsterdamJS 2018

Testing JavaScript applications workshop - AmsterdamJS 2018

Ivan Jovanovic

May 31, 2018
Tweet

More Decks by Ivan Jovanovic

Other Decks in Technology

Transcript

  1. Excuses • My code is the best! • I don’t

    know how to test, it’s difficult • I don’t know what to test • It increases development time
  2. What do you need from the testing library? • Provide

    a testing structure (Mocha, Jasmine, Jest, Cucumber) • Provide assertions functions (Chai, Jasmine, Jest, Unexpected) • Generate, display, and watch test results (Mocha, Jasmine, Jest, Karma) • Generate and compare snapshots of component and data structures to make sure changes from previous runs are intended (Jest, Ava) • Provide mocks, spies, and stubs (Sinon, Jasmine, enzyme, Jest, testdouble) • Generate code coverage reports (Istanbul, Jest, Blanket) • Provide a browser or browser-like environment with a control on their scenarios execution (Cypress, Protractor, Nightwatch, Phantom, Casper)
  3. Coverage • Function coverage – Has each function (or subroutine)

    in the program been called? • Statement coverage – Has each statement in the program been executed? • Branch coverage – Has each branch (also called DD-path) of each control structure (such as in if and case statements) been executed? • Line coverage - Has each line been called?