describe('Slider', function () { var slider = null; beforeEach(function () { var templateSlider = [ '
' ].join(''); document.body.innerHTML += templateSlider; slider = document.getElementById('mySlider'); }); afterEach(function () { slider.parentNode.removeChild(slider); slider = null; }); it('Slider should fire slide event', function (done) { slider.addEventListener('slide', function () { expect(true).toBe(true); done(); }); TouchFaker.fakeEvent('touchstart', '#firstSlide'); }); });