javascript - How do I Run Jasmine Unit Tests Synchronously? -
i using chutzpah run jasmine javascript unit tests in visual studio. have globally scoped dom element need reset each time couple of tests run. using beforeeach() clear out dom element next test can use , populate accordingly. however, looks running async problems element being cleared in 1 test while executing in different test. bottom line: there way run each test synchronously in jasmine? current structure looks this:
describe('baseview', function () { beforeeach(function() { $('#elementtoclear').html(''); }); it('run 2.', function () { var baseview = new baseview(); baseview.populateelement(); expect($('#elementtoclear').html()).tobe('populated') }); it('run 1.', function () { var baseview = new baseview(); baseview.populateelement(); expect($('#elementtoclear').html()).tobe('populated') }); });
Comments
Post a Comment