title: Mongoose aggregation query fails in Jest/Mockgoose test, works elsewhere
body: <p>I'm trying to create some tests for my Mongoose models, and I can't figure out how to get the Jest/Mockgoose test to pass for a shorthand query/aggregation pipeline (see below in first code block) that I created to retrieve a random document from one collection that isn't referenced in another collection.</p>
  
  <pre><code>activitySchema.query.getUnused = function() {
      return Activity.aggregate()
          .lookup({
              from: 'userActivity',
              localField: '_id',
              foreignField: 'activity',
              as: 'matched_docs',
          })
          .match({ matched_docs: { $eq: [] } })
          .sample(1)
          .project({ matched_docs: 0, __v: 0 })
          .exec()
  }
  </code></pre>
  
  <p>Jest test </p>
  
  <pre><code>describe('Activity methods', () =&gt; {
      test('Activity unused query executes', (done) =&gt; {
          function createActivity() {
              return Activity
                  .create({ activity: 'running' })
                  .then(activity =&gt; {
                      console.log('Activity is generated')
                      return Promise.resolve(true)
                  })
          }
          async function retrieveActivity() {
              await createActivity()
              Activity
                  .find()
                  .getUnused()
                  .then(unused =&gt; {
                      console.log(unused);
                      expect(unused).toHaveLength(1)
                      done()
                  })
                  .catch(x =&gt; {
                  console.log(x)
                  })
          }
  
  
          return retrieveActivity()
      })
  
  })
  </code></pre>
  
  <p>Sandbox Node JS code:</p>
  
  <pre><code>Activity.find().getUnused()
      .then((x) =&gt; {
       console.log(x);
  })
  </code></pre>
  
  <p>When I try it in a sandbox node file, wit works normally and retrieves a typical queryset like: </p>
  
  <pre><code>   [ { _id: 58f3dee3b0346910a69e6e5d, activity: 'running', __v: 0 } ]
  </code></pre>
  
  <p>When I run the test, I get this MongoError:</p>
  
  <pre><code>The 'cursor' option is required, except for aggregation explain
  </code></pre>
  
  <p>How do I fix this with a universal manner that works in both contexts? I'd like for the method to return a promise if possible. I've tried both the chained aggregate methods (see above) and the more native Mongo aggregate array for pipelines, but both return errors. My mongo version is 3.4.2 if that's relevant.</p>