I have a mongoose model:
var mongoose = require(\"mongoose\");
var transactionSchema = mongoose.Schema({
category: { type: String, required: [true, \"Cate
The error means exactly what it says, done
wasn't defined but it's used. And it isn't needed in case promises are used. Jest supports promises, a promise should be returned from a block in order to be properly handled:
afterEach(() => mockgoose.helper.reset());
If there's a problem with open handles as in this question, Mongoose can be explicitly disconnected with:
afterAll(() => mongoose.disconnect());