()
| 172 | it('should close the listeners after the cursor is closed', { |
| 173 | metadata: { requires: { topology: 'replicaset' } }, |
| 174 | async test() { |
| 175 | const collection = db.collection('closesListeners'); |
| 176 | const changeStream = collection.watch(pipeline); |
| 177 | const willBeChanges = on(changeStream, 'change'); |
| 178 | await once(changeStream.cursor, 'init'); |
| 179 | await collection.insertOne({ a: 1 }); |
| 180 | |
| 181 | await willBeChanges.next(); |
| 182 | expect(changeStream.cursorStream?.listenerCount('data')).to.equal(1); |
| 183 | |
| 184 | await changeStream.close(); |
| 185 | expect(changeStream.cursorStream).to.not.exist; |
| 186 | } |
| 187 | }); |
| 188 | |
| 189 | it('contains a wallTime date property on the change', { |
nothing calls this directly
no test coverage detected