Added some mocking

Used sinon for some mocking