title: Jest: Testing generator function which yields another generator function
body: <p>I have a function which looks like this </p>
  
  <pre><code>export function* login(user, page) {
          yield checkIp();
          return yield loginAuth(user, page);
   }
  </code></pre>
  
  <p>I am trying to test the login generator from unit test as below </p>
  
  <pre><code>it('login test', () =&gt; {
    const user = { email:"test@test.com", password:"1234" }
   const generator = login (user, {});
   generator.next();
   expect(generator.return().done).toEqual(true); });
  </code></pre>
  
  <p>Is this the right way to do it? Also in the coverage, I am not able to cover the return statement from the login generator function.
  Any help would be much appreciated.</p>
  
  <p>Also this is my first time posting here, forgive me if I didn't follow the rules correctly.</p>