software under test used as a baseline for running tests. In JavaScript for client side: simulate AJAX responses; loading known set of data such as html objects.
function() { console.log(‘first test’); }); test(‘second test’, function() { console.log(‘second test’);}); afterEach(function() { console.log(‘after each test’); }); Result before test first test after each test second test after each test BASIC STRUCTURE: EXPLAINED
Unittests wor k bestinisol ation Mocks, stubs and spies hel p toisol ate test Don’ttestever ythingbutwr ite many tests > 40 tool s ar e avail abl e to ease unittesting exper ience, soCHOOSE YOUR OWN!