How to use the mockingoose.resetAll function in mockingoose

To help you get started, we’ve selected a few mockingoose examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenNeuroOrg / openneuro / packages / openneuro-server / datalad / __tests__ / snapshots.spec.js View on Github external
beforeEach(() => {
      mockingoose.resetAll()
      // Setup a default sequence value to return for each test
      mockingoose.Counter.toReturn(
        { _id: 'dataset', sequence_value: 1 },
        'findOneAndUpdate',
      )
    })
    it('posts to the DataLad /datasets/{dsId}/snapshots/{snapshot} endpoint', async done => {
github OpenNeuroOrg / openneuro / packages / openneuro-server / datalad / __tests__ / pagination.spec.js View on Github external
beforeEach(() => {
      mockingoose.resetAll()
      mockingoose.Dataset.toReturn(
        [
          {
            datasets: [
              {
                _id: ObjectID('5bef51a1ed211400c08e5524'),
                id: 'ds001001',
                created: new Date('2018-11-16T23:24:17.203Z'),
                modified: new Date('2018-11-16T23:24:25.050Z'),
                uploader: 'f8d5a57c-879a-40e6-b151-e34c4a28ff70',
                revision: '262a8e610e32b5766cbf669acc71911c1ece7126',
              },
            ],
            count: 1,
          },
        ],

mockingoose

A Jest package for mocking mongoose models

Unlicense
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis