How to test redux saga using jest?

I'm noob at front-end dev, but try to write tests for project. Also, I'm using redux-saga and jest for testing btw, I have saga:

export function* setAuthorizeCode(action) {
  try {
    let response = yield call(Api.token.getToken, action.payload.authorizeCode);

    yield put(appActions.setAccessToken(;
    yield put(appActions.setIdToken(;

    const accessToken = yield select((state) => appSelectors.getAccessToken(;
    const idToken = yield select((state) => appSelectors.getIdToken(;

    response = yield call(Api.user.getUser, accessToken, idToken);
    yield put(appActions.setUser(;
  } catch (error) {
    console.log('Error: ', error);

function* setAuhtorizeCodeFlow () {
  yield takeLatest(appActions.SET_AUTHORIZE_CODE, setAuthorizeCode);

export default function* authentication() {
  yield all([

And I'm write this test for this:

test('TESTING SAGAS', function(t)  {
  const gen = setAuthorizeCode()
  let next =
  t.deepEqual(next.value, call(Api.token.getToken), 'must yield api.getToken')

  next =
  t.deepEqual(next.value, put(appActions.setAccessToken(accessToken)), 'must yield action appActions.setAccessToken')

  next =
  t.deepEqual(next.value, put(appActions.setIdToken(idToken)), 'must yield action appActions.setIdToken')

  next =
  t.deepEqual(next.value, select(accessToken), 'must select accessToken')

  next =
  t.deepEqual(next.value, select(idToken), 'must select idToken')

  next =
  t.deepEqual(next.value, call(Api.user.getUser), 'must yield api.getUser')

  next =
  t.deepEqual(next.value, put(appActions.setUser(setUser)), 'must yield appActions.setUser')


I really don't know what is wrong. But it's doesn't work, please I need some help, what am I doing wrong?

There is errors:

operator: deepEqual 
expected: |- { '@@redux-saga/IO': true, CALL: { context: null, fn: 
[Function: getToken], args: [] } } 
actual: |- undefined

And other 2 are the same.