Migrating tests to use sinon js