From d3e3b2f8af07235b6c3dfa18912ae794e120cc03 Mon Sep 17 00:00:00 2001 From: mohammad0-0ahmad Date: Wed, 6 Apr 2022 00:57:15 +0200 Subject: [PATCH] Refactor test in query.test.js file. --- test/query.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/query.test.js b/test/query.test.js index 82698b13817..2b342a490f5 100644 --- a/test/query.test.js +++ b/test/query.test.js @@ -3947,7 +3947,6 @@ describe('Query', function() { }); it('should return query helper supplied in schema options query property instead of undefined', function(done) { - const Model = db.model('Test', new Schema({ userName: { type: String, @@ -3962,7 +3961,9 @@ describe('Query', function() { })); Model.create({ userName: 'test' }, function(error) { - assert.ifError(error); + if (error instanceof Error) { + return done(error); + } Model.find().byUserName('test').exec(function(error, docs) { if (error instanceof Error) { return done(error);