UNPKG

mongoose-data-seed

Version:

Seed mongodb with data using mongoose models

15 lines (10 loc) 459 B
import sinon from 'sinon'; export const alreadyExistsFilename = 'exists'; export const alreadyExistsPath = `/path/${alreadyExistsFilename}`; export const throwableMkdirPath = '/path/will-throw'; const existsSync = sinon.stub(); existsSync.returns(false); existsSync.withArgs(alreadyExistsPath).returns(true); const mkdirSync = sinon.stub(); mkdirSync.withArgs(throwableMkdirPath).throws(new Error('some-error')); export default { existsSync, mkdirSync };