()
| 156 | |
| 157 | // Each test runs the same find operation, but asserts different outcomes |
| 158 | const operation = async () => { |
| 159 | cursor = cappedCollection.find({ _id: { $gt: 0 } }, { ...options, batchSize: 1 }); |
| 160 | const findDocOrError: { _id: number } | Error = await cursor.next().catch(error => error); |
| 161 | const exhaustedByFind = !!cursor.id?.isZero(); |
| 162 | const getMoreDocOrError: { _id: number } | Error | null = await cursor |
| 163 | .tryNext() |
| 164 | .catch(error => error); |
| 165 | expect(events).to.have.length.of.at.least(1); // At least find must be sent |
| 166 | return { findDocOrError, exhaustedByFind, getMoreDocOrError }; |
| 167 | }; |
| 168 | |
| 169 | if (outcome.isFindError) { |
| 170 | it(`should error on find due to setting ${optionsString}`, metadata, async () => { |
no test coverage detected