1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-18 09:35:20 +02:00
joplin/packages/app-mobile/components/screens/ConfigScreen/plugins/testUtils/newRepoApi.ts
Henry Heino c972ce223e
Mobile: Fixes #10593: Fix plugin list not cached in config screen (#10599)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2024-06-18 10:02:42 +01:00

14 lines
567 B
TypeScript

import { AppType } from '@joplin/lib/models/Setting';
import RepositoryApi, { InstallMode } from '@joplin/lib/services/plugins/RepositoryApi';
import { createTempDir, supportDir } from '@joplin/lib/testing/test-utils';
const newRepoApi = async (installMode: InstallMode, appVersion = '3.0.0'): Promise<RepositoryApi> => {
const appInfo = { type: AppType.Mobile, version: appVersion };
const repo = new RepositoryApi(`${supportDir}/pluginRepo`, await createTempDir(), appInfo, installMode);
await repo.reinitialize();
return repo;
};
export default newRepoApi;