mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
remove double test with only a single change
This commit is contained in:
parent
213f1e1d3e
commit
f403fc4192
@ -1,6 +1,29 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { IotaClientSingleton } from '@/client/IotaClientSingleton'
|
||||
import CONFIG from '@/config'
|
||||
import { logger } from '@/server/logger'
|
||||
|
||||
describe('apis/IotaClientSingleton/disabled', () => {
|
||||
beforeEach(() => {
|
||||
CONFIG.IOTA = false
|
||||
})
|
||||
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...')
|
||||
})
|
||||
})
|
||||
|
||||
describe('apis/IotaClientSingleton/invalidIotaUrl', () => {
|
||||
beforeEach(() => {
|
||||
CONFIG.IOTA = true
|
||||
CONFIG.IOTA_API_URL = 'invalidUrl'
|
||||
})
|
||||
it('throw exception on invalid iota url', () => {
|
||||
// eslint-disable-next-line jest/unbound-method
|
||||
expect(IotaClientSingleton.getInstance).toThrow()
|
||||
})
|
||||
})
|
||||
|
||||
describe('apis/IotaClientSingleton/enabled', () => {
|
||||
describe('Hello World', () => {
|
||||
|
||||
@ -34,8 +34,9 @@ class IotaClientSingleton {
|
||||
return
|
||||
}
|
||||
if (!IotaClientSingleton.instance) {
|
||||
const client = new ClientBuilder().node(CONFIG.IOTA_API_URL).build()
|
||||
IotaClientSingleton.instance = new IotaClientSingleton()
|
||||
IotaClientSingleton.instance.client = new ClientBuilder().node(CONFIG.IOTA_API_URL).build()
|
||||
IotaClientSingleton.instance.client = client
|
||||
}
|
||||
|
||||
return IotaClientSingleton.instance
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
import { IotaClientSingleton } from '@/client/IotaClientSingleton'
|
||||
import CONFIG from '@/config'
|
||||
import { logger } from '@/server/logger'
|
||||
|
||||
describe('apis/IotaClientSingleton/disabled', () => {
|
||||
beforeEach(() => {
|
||||
CONFIG.IOTA = false
|
||||
})
|
||||
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...')
|
||||
})
|
||||
})
|
||||
|
||||
describe('apis/IotaClientSingleton/invalidIotaUrl', () => {
|
||||
beforeEach(() => {
|
||||
CONFIG.IOTA = true
|
||||
CONFIG.IOTA_API_URL = 'invalidUrl'
|
||||
})
|
||||
it('throw exception on invalid iota url', () => {
|
||||
// eslint-disable-next-line jest/unbound-method
|
||||
expect(IotaClientSingleton.getInstance).toThrow()
|
||||
})
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user