Hi there,
Being a newbie to Sinon, i am trying sinon with mocha to put assertions on specific function calls.
describe("Test Suite", function() {
beforeEach(function() {
spy = sinon.spy(window._gaq, 'push');
});
afterEach(function() {
spy.restore();
});
it ("Track link"), function() {
link = $('*[data-type]');
link.click();
sinon.assert.called(spy);
});
})(i)
}
});
Now, i am trying to put one more assertion for function call. For that one more spy() assignments is placed inside beforeEach(). But after this, the code snippet is not working.
....
beforeEach(function() {
spy = sinon.spy(window._gaq, 'push');
spy = sinon.spy(window, 'trackItems');
});
.....
Please advice how can i set mulitple spy assignments. Any help would be a life savor for me.
Regards,
Lokesh