File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -53,16 +53,26 @@ describe('connection', () => {
5353 const conn = new SQLiteCloudConnection ( configObj )
5454 expect ( conn ) . toBeDefined ( )
5555
56- conn . connect ( error => {
57- expect ( error ) . toBeNull ( )
58- expect ( conn . connected ) . toBe ( true )
59-
56+ // already connected?
57+ if ( conn . connected ) {
6058 chinook . sendCommands ( 'TEST STRING' , ( error , results ) => {
6159 conn . close ( )
6260 expect ( conn . connected ) . toBe ( false )
6361 done ( )
6462 } )
65- } )
63+ } else {
64+ // not connected, so connect...
65+ conn . connect ( error => {
66+ expect ( error ) . toBeNull ( )
67+ expect ( conn . connected ) . toBe ( true )
68+
69+ chinook . sendCommands ( 'TEST STRING' , ( error , results ) => {
70+ conn . close ( )
71+ expect ( conn . connected ) . toBe ( false )
72+ done ( )
73+ } )
74+ } )
75+ }
6676 } )
6777
6878 it ( 'should connect with connection string' , done => {
You can’t perform that action at this time.
0 commit comments