1- import { TestBed } from '@angular/core/testing' ;
21import { provideZonelessChangeDetection } from '@angular/core' ;
2+ import { TestBed } from '@angular/core/testing' ;
33import { provideNoopAnimations } from '@angular/platform-browser/animations' ;
4+ import { ElectronService } from '@keira/shared/common-services' ;
45import { Connection , ConnectionOptions , QueryError } from 'mysql2' ;
6+ import { tickAsync } from 'ngx-page-object-model' ;
57import { Subscriber } from 'rxjs' ;
68import { instance , mock , reset } from 'ts-mockito' ;
7- import { ElectronService } from '@keira/shared/common-services' ;
89import { MysqlService } from './mysql.service' ;
910import Spy = jasmine . Spy ;
10- import { tickAsync } from 'ngx-page-object-model' ;
1111
1212class MockMySql {
1313 createConnection ( ) { }
@@ -213,7 +213,7 @@ describe('MysqlService', () => {
213213 it ( 'reconnect() should correctly work ' , async ( ) => {
214214 service [ '_reconnecting' ] = false ;
215215 spyOn ( service [ '_connectionLostSubject' ] , 'next' ) ;
216- spyOn ( console , 'log ' ) ;
216+ spyOn ( console , 'info ' ) ;
217217 ( service as any ) . mysql = new MockMySql ( ) ;
218218 const mockConnection = new MockConnection ( ) ;
219219 spyOn ( ( service as any ) . mysql , 'createConnection' ) . and . returnValue ( mockConnection ) ;
@@ -223,8 +223,8 @@ describe('MysqlService', () => {
223223 expect ( service [ '_reconnecting' ] ) . toBe ( true ) ;
224224 expect ( service [ '_connectionLostSubject' ] . next ) . toHaveBeenCalledTimes ( 1 ) ;
225225 expect ( service [ '_connectionLostSubject' ] . next ) . toHaveBeenCalledWith ( false ) ;
226- expect ( console . log ) . toHaveBeenCalledTimes ( 1 ) ;
227- expect ( console . log ) . toHaveBeenCalledWith ( `DB connection lost. Reconnecting in 500 ms...` ) ;
226+ expect ( console . info ) . toHaveBeenCalledTimes ( 1 ) ;
227+ expect ( console . info ) . toHaveBeenCalledWith ( `DB connection lost. Reconnecting in 500 ms...` ) ;
228228
229229 await tickAsync ( 500 ) ;
230230 expect ( service [ '_connection' ] ) . toEqual ( mockConnection as unknown as Connection ) ;
0 commit comments