Fixing promises for async tests