|
|
@ -1,4 +1,5 @@
|
|
|
|
import { CurrentRateService } from '@ghostfolio/api/app/core/current-rate.service';
|
|
|
|
import { CurrentRateService } from '@ghostfolio/api/app/core/current-rate.service';
|
|
|
|
|
|
|
|
import { DataProviderService } from '@ghostfolio/api/services/data-provider.service';
|
|
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service';
|
|
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service';
|
|
|
|
import { Currency, MarketData } from '@prisma/client';
|
|
|
|
import { Currency, MarketData } from '@prisma/client';
|
|
|
|
|
|
|
|
|
|
|
@ -37,16 +38,26 @@ jest.mock('../../services/exchange-rate-data.service', () => {
|
|
|
|
|
|
|
|
|
|
|
|
describe('CurrentRateService', () => {
|
|
|
|
describe('CurrentRateService', () => {
|
|
|
|
let currentRateService: CurrentRateService;
|
|
|
|
let currentRateService: CurrentRateService;
|
|
|
|
|
|
|
|
let dataProviderService: DataProviderService;
|
|
|
|
let exchangeRateDataService: ExchangeRateDataService;
|
|
|
|
let exchangeRateDataService: ExchangeRateDataService;
|
|
|
|
let marketDataService: MarketDataService;
|
|
|
|
let marketDataService: MarketDataService;
|
|
|
|
|
|
|
|
|
|
|
|
beforeAll(async () => {
|
|
|
|
beforeAll(async () => {
|
|
|
|
|
|
|
|
dataProviderService = new DataProviderService(
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
);
|
|
|
|
exchangeRateDataService = new ExchangeRateDataService(null);
|
|
|
|
exchangeRateDataService = new ExchangeRateDataService(null);
|
|
|
|
marketDataService = new MarketDataService(null);
|
|
|
|
marketDataService = new MarketDataService(null);
|
|
|
|
|
|
|
|
|
|
|
|
await exchangeRateDataService.initialize();
|
|
|
|
await exchangeRateDataService.initialize();
|
|
|
|
|
|
|
|
|
|
|
|
currentRateService = new CurrentRateService(
|
|
|
|
currentRateService = new CurrentRateService(
|
|
|
|
|
|
|
|
dataProviderService,
|
|
|
|
exchangeRateDataService,
|
|
|
|
exchangeRateDataService,
|
|
|
|
marketDataService
|
|
|
|
marketDataService
|
|
|
|
);
|
|
|
|
);
|
|
|
|