(input, output)
| 1636 | |
| 1637 | context('sort', function () { |
| 1638 | const findSort = (input, output) => |
| 1639 | async function () { |
| 1640 | const client = this.configuration.newClient({ monitorCommands: true }); |
| 1641 | const events = []; |
| 1642 | client.on('commandStarted', event => { |
| 1643 | if (event.commandName === 'find') { |
| 1644 | events.push(event); |
| 1645 | } |
| 1646 | }); |
| 1647 | const db = client.db('test'); |
| 1648 | const collection = db.collection('test_sort_dos'); |
| 1649 | const cursor = collection.find({}, { sort: input }); |
| 1650 | await cursor.next(); |
| 1651 | expect(events[0].command.sort).to.be.instanceOf(Map); |
| 1652 | expect(Array.from(events[0].command.sort)).to.deep.equal(Array.from(output)); |
| 1653 | await client.close(); |
| 1654 | }; |
| 1655 | |
| 1656 | const cursorSort = (input, output) => |
| 1657 | async function () { |
no test coverage detected