Skip to content

Commit

Permalink
test(query): repro #8159
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Sep 22, 2019
1 parent 382db6d commit 1e0cc7a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/query.toconstructor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,14 @@ describe('Query:', function() {
assert.strictEqual(called, 1);
});
});

it('works with entries-style sort() syntax (gh-8159)', function() {
const Model = mongoose.model('Test', Schema({ name: String }));

const query = Model.find().sort([['name', 1]]);
const Query = query.toConstructor();
const q = new Query();
assert.deepEqual(q.options.sort, [['name', 1]]);
});
});
});

0 comments on commit 1e0cc7a

Please sign in to comment.