@@ -19,27 +19,27 @@ describeWithMongoDB("Connection Manager", (integration) => {
1919 await connectionManager ( ) . disconnect ( ) ;
2020 // for testing, force disconnecting AND setting the connection to closed to reset the
2121 // state of the connection manager
22- connectionManager ( ) . changeState ( "connection-closed " , { tag : "disconnected" } ) ;
22+ connectionManager ( ) . changeState ( "connection-close " , { tag : "disconnected" } ) ;
2323 } ) ;
2424
2525 describe ( "when successfully connected" , ( ) => {
2626 type ConnectionManagerSpies = {
27- "connection-requested " : ( event : ConnectionManagerEvents [ "connection-requested " ] [ 0 ] ) => void ;
28- "connection-succeeded " : ( event : ConnectionManagerEvents [ "connection-succeeded " ] [ 0 ] ) => void ;
29- "connection-timed -out" : ( event : ConnectionManagerEvents [ "connection-timed -out" ] [ 0 ] ) => void ;
30- "connection-closed " : ( event : ConnectionManagerEvents [ "connection-closed " ] [ 0 ] ) => void ;
31- "connection-errored " : ( event : ConnectionManagerEvents [ "connection-errored " ] [ 0 ] ) => void ;
27+ "connection-request " : ( event : ConnectionManagerEvents [ "connection-request " ] [ 0 ] ) => void ;
28+ "connection-success " : ( event : ConnectionManagerEvents [ "connection-succeess " ] [ 0 ] ) => void ;
29+ "connection-time -out" : ( event : ConnectionManagerEvents [ "connection-time -out" ] [ 0 ] ) => void ;
30+ "connection-close " : ( event : ConnectionManagerEvents [ "connection-close " ] [ 0 ] ) => void ;
31+ "connection-error " : ( event : ConnectionManagerEvents [ "connection-error " ] [ 0 ] ) => void ;
3232 } ;
3333
3434 let connectionManagerSpies : ConnectionManagerSpies ;
3535
3636 beforeEach ( async ( ) => {
3737 connectionManagerSpies = {
38- "connection-requested " : vi . fn ( ) ,
39- "connection-succeeded " : vi . fn ( ) ,
40- "connection-timed -out" : vi . fn ( ) ,
41- "connection-closed " : vi . fn ( ) ,
42- "connection-errored " : vi . fn ( ) ,
38+ "connection-request " : vi . fn ( ) ,
39+ "connection-success " : vi . fn ( ) ,
40+ "connection-time -out" : vi . fn ( ) ,
41+ "connection-close " : vi . fn ( ) ,
42+ "connection-error " : vi . fn ( ) ,
4343 } ;
4444
4545 for ( const [ event , spy ] of Object . entries ( connectionManagerSpies ) ) {
@@ -62,11 +62,11 @@ describeWithMongoDB("Connection Manager", (integration) => {
6262 } ) ;
6363
6464 it ( "should notify that the connection was requested" , ( ) => {
65- expect ( connectionManagerSpies [ "connection-requested " ] ) . toHaveBeenCalledOnce ( ) ;
65+ expect ( connectionManagerSpies [ "connection-request " ] ) . toHaveBeenCalledOnce ( ) ;
6666 } ) ;
6767
6868 it ( "should notify that the connection was successful" , ( ) => {
69- expect ( connectionManagerSpies [ "connection-succeeded " ] ) . toHaveBeenCalledOnce ( ) ;
69+ expect ( connectionManagerSpies [ "connection-success " ] ) . toHaveBeenCalledOnce ( ) ;
7070 } ) ;
7171
7272 describe ( "when disconnects" , ( ) => {
@@ -75,7 +75,7 @@ describeWithMongoDB("Connection Manager", (integration) => {
7575 } ) ;
7676
7777 it ( "should notify that it was disconnected before connecting" , ( ) => {
78- expect ( connectionManagerSpies [ "connection-closed " ] ) . toHaveBeenCalled ( ) ;
78+ expect ( connectionManagerSpies [ "connection-close " ] ) . toHaveBeenCalled ( ) ;
7979 } ) ;
8080
8181 it ( "should be marked explicitly as disconnected" , ( ) => {
@@ -91,11 +91,11 @@ describeWithMongoDB("Connection Manager", (integration) => {
9191 } ) ;
9292
9393 it ( "should notify that it was disconnected before connecting" , ( ) => {
94- expect ( connectionManagerSpies [ "connection-closed " ] ) . toHaveBeenCalled ( ) ;
94+ expect ( connectionManagerSpies [ "connection-close " ] ) . toHaveBeenCalled ( ) ;
9595 } ) ;
9696
9797 it ( "should notify that it was connected again" , ( ) => {
98- expect ( connectionManagerSpies [ "connection-succeeded " ] ) . toHaveBeenCalled ( ) ;
98+ expect ( connectionManagerSpies [ "connection-success " ] ) . toHaveBeenCalled ( ) ;
9999 } ) ;
100100
101101 it ( "should be marked explicitly as connected" , ( ) => {
@@ -115,11 +115,11 @@ describeWithMongoDB("Connection Manager", (integration) => {
115115 } ) ;
116116
117117 it ( "should notify that it was disconnected before connecting" , ( ) => {
118- expect ( connectionManagerSpies [ "connection-closed " ] ) . toHaveBeenCalled ( ) ;
118+ expect ( connectionManagerSpies [ "connection-close " ] ) . toHaveBeenCalled ( ) ;
119119 } ) ;
120120
121121 it ( "should notify that it failed connecting" , ( ) => {
122- expect ( connectionManagerSpies [ "connection-errored " ] ) . toHaveBeenCalledWith ( {
122+ expect ( connectionManagerSpies [ "connection-error " ] ) . toHaveBeenCalledWith ( {
123123 tag : "errored" ,
124124 connectedAtlasCluster : undefined ,
125125 connectionStringAuthType : "scram" ,
@@ -152,11 +152,11 @@ describeWithMongoDB("Connection Manager", (integration) => {
152152 } ) ;
153153
154154 it ( "should notify that it was disconnected before connecting" , ( ) => {
155- expect ( connectionManagerSpies [ "connection-closed " ] ) . toHaveBeenCalled ( ) ;
155+ expect ( connectionManagerSpies [ "connection-close " ] ) . toHaveBeenCalled ( ) ;
156156 } ) ;
157157
158158 it ( "should notify that it failed connecting" , ( ) => {
159- expect ( connectionManagerSpies [ "connection-errored " ] ) . toHaveBeenCalledWith ( {
159+ expect ( connectionManagerSpies [ "connection-error " ] ) . toHaveBeenCalledWith ( {
160160 tag : "errored" ,
161161 connectedAtlasCluster : atlas ,
162162 connectionStringAuthType : "scram" ,
0 commit comments