feat(cli): add os-aware install hints for minio extractor dependencies
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import {
|
||||
checkMinioExtractorStatus,
|
||||
getMinioExtractorInstallHints,
|
||||
renderMinioExtractorSetupLines,
|
||||
summarizeMinioExtractorStatus,
|
||||
} from './minioExtractors.js';
|
||||
@@ -38,4 +39,25 @@ describe('minio extractor requirements', () => {
|
||||
expect(status.availableDocxExtractors).toEqual(['pandoc']);
|
||||
expect(status.missingRequirements).toEqual([]);
|
||||
});
|
||||
|
||||
it('returns Homebrew install hint on macOS when extractors are missing', async () => {
|
||||
const status = await checkMinioExtractorStatus(
|
||||
{ backup: { minio: { enabled: true } } },
|
||||
async () => false,
|
||||
);
|
||||
const hints = await getMinioExtractorInstallHints(status, { platform: 'darwin' });
|
||||
expect(hints).toEqual(['brew install poppler pandoc']);
|
||||
});
|
||||
|
||||
it('returns apt-get install hint on Linux when apt-get is available', async () => {
|
||||
const status = await checkMinioExtractorStatus(
|
||||
{ backup: { minio: { enabled: true } } },
|
||||
async () => false,
|
||||
);
|
||||
const hints = await getMinioExtractorInstallHints(status, {
|
||||
platform: 'linux',
|
||||
exists: async (command) => command === 'apt-get',
|
||||
});
|
||||
expect(hints).toEqual(['sudo apt-get install -y poppler-utils pandoc']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user