2025-12-11 10:40:55 +01:00
|
|
|
/*
|
2026-01-12 15:00:36 +01:00
|
|
|
* Copyright (c) 2026 by Christian Kellner.
|
2025-12-11 10:40:55 +01:00
|
|
|
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2026-03-16 14:26:58 +01:00
|
|
|
import { vi } from 'vitest';
|
2023-03-13 13:42:43 +01:00
|
|
|
import { readFile } from 'fs/promises';
|
|
|
|
|
import * as mockStore from './mocks/mockStore.js';
|
|
|
|
|
import { send } from './mocks/mockNotification.js';
|
|
|
|
|
|
2026-04-12 09:17:23 +02:00
|
|
|
export const providerConfig = JSON.parse(
|
|
|
|
|
await readFile(new URL('./provider/testProvider.json', import.meta.url), 'utf-8'),
|
|
|
|
|
);
|
2023-03-13 13:42:43 +01:00
|
|
|
|
2026-03-16 14:26:58 +01:00
|
|
|
vi.mock('../lib/services/storage/listingsStorage.js', () => mockStore);
|
|
|
|
|
vi.mock('../lib/services/storage/settingsStorage.js', () => mockStore);
|
|
|
|
|
vi.mock('../lib/services/geocoding/geoCodingService.js', () => ({
|
|
|
|
|
geocodeAddress: mockStore.getGeocoordinatesByAddress,
|
|
|
|
|
}));
|
|
|
|
|
vi.mock('../lib/services/storage/jobStorage.js', () => ({
|
|
|
|
|
getJob: (jobKey) => ({ id: jobKey, userId: 'user1' }),
|
|
|
|
|
}));
|
|
|
|
|
vi.mock('../lib/notification/notify.js', () => ({ send }));
|
|
|
|
|
|
2026-04-12 09:17:23 +02:00
|
|
|
/**
|
|
|
|
|
* @returns {Promise<typeof import('../lib/FredyPipelineExecutioner.js').default>}
|
|
|
|
|
*/
|
2023-03-13 13:42:43 +01:00
|
|
|
export const mockFredy = async () => {
|
2026-03-16 14:26:58 +01:00
|
|
|
const mod = await import('../lib/FredyPipelineExecutioner.js');
|
2026-04-12 09:17:23 +02:00
|
|
|
return mod.default;
|
2023-03-13 13:42:43 +01:00
|
|
|
};
|