improving tests by using less sinon