used chai and sinon to do more unit test.