title: redux saga unit test expected but received deep-equality error
body: <p>Getting this error when unit testing a simple api call in redux saga. </p>
  
  <blockquote>
    <p>● My feature › testing api call</p>
  
  <pre><code>expect(received).toEqual(expected) // deep equality
  
  - Expected
  + Received
  
    Object {
      "@@redux-saga/IO": true,
      "combinator": false,
      "payload": Object {
  -     "args": Array [
  -       Object {
  -         "completed": false,
  -         "id": 1,
  -         "title": "delectus aut autem",
  -         "userId": 1,
  -       },
  -     ],
  +     "args": Array [],
        "context": null,
        "fn": [Function getData],
      },
      "type": "CALL",
    }
  </code></pre>
  </blockquote>
  
  <p>I have the api call that is set up like this. </p>
  
  <pre><code>import axios from 'axios';   
  export default {
    json: {
      getData: () =&gt; axios.get('https://jsonplaceholder.typicode.com/todos').then(res =&gt; res.data.slice(0, 1)),
    },
  };
  </code></pre>
  
  <p>this api call is being used here in a redux-saga function.</p>
  
  <p><strong>Redux-saga</strong></p>
  
  <pre><code>import {
    put, fork, takeLatest, call,
  } from 'redux-saga/effects';
  import { GET_DATA_SAGA } from '../actions/types';
  import api from '../api';
  import { fetchDataSuccess, fetchDataError } from '../actions/dataActions';
  
  export function* getData() {
    try {
      const data = yield call(api.json.getData);
  
      console.log(data);
  
      yield put(fetchDataSuccess(data));
    } catch (err) {
      yield put(fetchDataError(err));
    }
  }
  
  export function* watchData() {
    yield takeLatest(GET_DATA_SAGA, getData);
  }
  
  export default function* () {
    yield fork(watchData);
  }
  </code></pre>
  
  <p>How should i be unit testing this properly, am i missing something ?</p>
  
  <p>I'm also referencing this tutorial </p>
  
  <p><a href="https://codeburst.io/how-i-test-redux-saga-fcc425cda018" rel="nofollow noreferrer">https://codeburst.io/how-i-test-redux-saga-fcc425cda018</a></p>
  
  <p><strong>redux-saga unit test</strong></p>
  
  <pre><code>import {
    put, fork, takeLatest, call,
  } from 'redux-saga/effects';
  import { GET_DATA_SAGA } from '../actions/types';
  import {expectSaga} from 'redux-saga-test-plan';
  import { fetchDataSuccess, fetchDataError } from '../actions/dataActions';
  import api from '../api';
  import { cloneableGenerator } from '@redux-saga/testing-utils';
  import {getData} from './data';
  
  const testData = {
    userId: 1, 
    id: 1, 
    title: "delectus aut autem", 
    completed: false
  }
  
  describe('My feature', () =&gt; {
    it('testing api call', () =&gt; {
      // const data = getData(api.json.getData);
      // console.log(data)
      const generator = cloneableGenerator(getData)(fetchDataSuccess)
      // console.log(generator)
      expect(generator.next().value).toEqual(call(api.json.getData, testData));
    })
  })
  </code></pre>