@@ -5,7 +5,7 @@ import { inspect } from 'util';
5
5
6
6
import { type Collection , type FindCursor , MongoAPIError , type MongoClient } from '../../mongodb' ;
7
7
8
- describe ( 'class AbstractCursor' , function ( ) {
8
+ describe . only ( 'class AbstractCursor' , function ( ) {
9
9
describe ( 'regression tests NODE-5372' , function ( ) {
10
10
let client : MongoClient ;
11
11
let collection : Collection ;
@@ -38,7 +38,7 @@ describe('class AbstractCursor', function () {
38
38
} ) ;
39
39
} ) ;
40
40
41
- describe ( 'cursor iteration APIs' , function ( ) {
41
+ describe . only ( 'cursor iteration APIs' , function ( ) {
42
42
let client : MongoClient ;
43
43
let collection : Collection ;
44
44
const transformSpy = sinon . spy ( doc => ( { ...doc , name : doc . name . toUpperCase ( ) } ) ) ;
@@ -96,7 +96,6 @@ describe('class AbstractCursor', function () {
96
96
expect ( doc . name ) . to . equal ( 'JOHN DOE' ) ;
97
97
} ) ;
98
98
99
- // skipped because these tests fail after throwing uncaught exceptions
100
99
it ( `when the transform throws, ${ method } () propagates the error to the user` , async ( ) => {
101
100
const cursor = collection . find ( ) . map ( ( ) => {
102
101
throw new Error ( 'error thrown in transform' ) ;
@@ -106,6 +105,7 @@ describe('class AbstractCursor', function () {
106
105
expect ( error )
107
106
. to . be . instanceOf ( Error )
108
107
. to . match ( / e r r o r t h r o w n i n t r a n s f o r m / ) ;
108
+ expect ( cursor . closed ) . to . be . true ;
109
109
} ) ;
110
110
}
111
111
@@ -130,6 +130,7 @@ describe('class AbstractCursor', function () {
130
130
expect ( error )
131
131
. to . be . instanceOf ( Error )
132
132
. to . match ( / e r r o r t h r o w n i n t r a n s f o r m / ) ;
133
+ expect ( cursor . _cursor ) . to . have . property ( 'closed' , true ) ;
133
134
} ) ;
134
135
} ) ;
135
136
0 commit comments