File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed
Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -737,13 +737,10 @@ describe('e2e', function () {
737737
738738 it ( 'throws the .toArray() suggestion when a user attempts to serialize a cursor' , async function ( ) {
739739 await shell . executeLine ( 'const b = db.test.find()' ) ;
740- await shell . executeLine ( 'b.b = b' ) ;
741740 await shell . executeLine ( 'console.log(JSON.stringify(b));' ) ;
742- await eventually ( ( ) => {
743- shell . assertContainsOutput (
744- 'Error serializing a cursor. Did you mean to call .toArray() first?'
745- ) ;
746- } ) ;
741+ shell . assertContainsOutput (
742+ 'Cannot serialize a cursor to JSON. Did you mean to call .toArray() first?'
743+ ) ;
747744 } ) ;
748745
749746 it ( 'expands explain output from aggregation indefinitely' , async function ( ) {
Original file line number Diff line number Diff line change @@ -809,7 +809,7 @@ describe('Cursor', function () {
809809 } catch ( e : any ) {
810810 expect ( e ) . to . be . instanceOf ( MongoshInvalidInputError ) ;
811811 expect ( e . message ) . to . contain (
812- 'Error serializing a cursor. Did you mean to call .toArray() first?'
812+ 'Cannot serialize a cursor to JSON . Did you mean to call .toArray() first?'
813813 ) ;
814814 expect ( e . code ) . to . equal ( CommonErrors . InvalidArgument ) ;
815815 }
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export default class Cursor extends AggregateOrFindCursor<ServiceProviderFindCur
4444 */
4545 toJSON ( ) : void {
4646 throw new MongoshInvalidInputError (
47- 'Error serializing a cursor. Did you mean to call .toArray() first?' ,
47+ 'Cannot serialize a cursor to JSON . Did you mean to call .toArray() first?' ,
4848 CommonErrors . InvalidArgument
4949 ) ;
5050 }
You can’t perform that action at this time.
0 commit comments