linter fixes

This commit is contained in:
einhornimmond 2023-06-18 17:58:12 +02:00
parent 797f8bf74e
commit 85e081e271
2 changed files with 6 additions and 6 deletions

View File

@ -30,15 +30,15 @@ class IotaClientSingleton {
*/
public static getInstance(): IotaClientSingleton | undefined {
if (!CONFIG.IOTA || !CONFIG.IOTA_API_URL) {
logger.info(`Iota are disabled via config...`)
logger.info(`Iota are disabled via config...`)
return
}
if (!IotaClientSingleton.instance) {
IotaClientSingleton.instance = new IotaClientSingleton()
try {
try {
IotaClientSingleton.instance.client = new ClientBuilder().node(CONFIG.IOTA_API_URL).build()
} catch(e){
logger.error('couldn\'t connect to iota')
} catch (e) {
logger.error("couldn't connect to iota")
return
}
}

View File

@ -9,7 +9,7 @@ describe('apis/IotaConnector/disabled', () => {
it('getInstance return undefined if iota is disabled', () => {
const spyLog = jest.spyOn(logger, 'info')
expect(IotaClientSingleton.getInstance()).toBeUndefined()
expect(spyLog).toHaveBeenCalledWith('Iota are disabled via config...');
expect(spyLog).toHaveBeenCalledWith('Iota are disabled via config...')
})
})
@ -21,6 +21,6 @@ describe('apis/IotaConnector/invalidIotaUrl', () => {
it('log "couldn\'t connect to iota"', () => {
const spyLog = jest.spyOn(logger, 'error')
expect(IotaClientSingleton.getInstance()).toBeUndefined()
expect(spyLog).toHaveBeenCalledWith('couldn\'t connect to iota')
expect(spyLog).toHaveBeenCalledWith("couldn't connect to iota")
})
})