Skip to content

Commit e00c561

Browse files
Refactor test in query.test.js file.
1 parent e2f189c commit e00c561

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/query.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3947,7 +3947,6 @@ describe('Query', function() {
39473947
});
39483948

39493949
it('should return query helper supplied in schema options query property instead of undefined', function(done) {
3950-
39513950
const Model = db.model('Test', new Schema({
39523951
userName: {
39533952
type: String,
@@ -3962,7 +3961,9 @@ describe('Query', function() {
39623961
}));
39633962

39643963
Model.create({ userName: 'test' }, function(error) {
3965-
assert.ifError(error);
3964+
if (error instanceof Error) {
3965+
return done(error);
3966+
}
39663967
Model.find().byUserName('test').exec(function(error, docs) {
39673968
if (error instanceof Error) {
39683969
return done(error);

0 commit comments

Comments
 (0)