2023-01-22 20:19:41 +00:00
|
|
|
import ComponentDetection from './componentDetection';
|
|
|
|
|
import fs from 'fs';
|
2023-01-21 21:56:51 +00:00
|
|
|
|
|
|
|
|
test('Downloads CLI', async () => {
|
2023-01-22 20:19:41 +00:00
|
|
|
ComponentDetection.downloadLatestRelease();
|
|
|
|
|
expect(fs.existsSync(ComponentDetection.componentDetectionPath));
|
2023-01-21 21:56:51 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Runs CLI', async () => {
|
2023-01-22 20:24:06 +00:00
|
|
|
await ComponentDetection.runComponentDetection('./test');
|
2023-01-22 20:19:41 +00:00
|
|
|
expect(fs.existsSync(ComponentDetection.outputPath));
|
2023-01-22 01:06:08 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Parses CLI output', async () => {
|
2023-01-22 20:19:41 +00:00
|
|
|
var manifests = await ComponentDetection.getManifestsFromResults();
|
|
|
|
|
expect(manifests?.length == 2);
|
2023-01-21 21:56:51 +00:00
|
|
|
});
|