mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
linter fixes
This commit is contained in:
parent
797f8bf74e
commit
85e081e271
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -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")
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user