Update tests

This commit is contained in:
Justin Hutchings
2023-01-22 20:19:41 +00:00
parent 12357ddc15
commit e07757ee54
4 changed files with 19 additions and 15 deletions

View File

@@ -1,13 +1,17 @@
import {downloadLatestRelease, getManifestsFromResults, runComponentDetection} from './componentDetection';
import ComponentDetection from './componentDetection';
import fs from 'fs';
test('Downloads CLI', async () => {
downloadLatestRelease();
ComponentDetection.downloadLatestRelease();
expect(fs.existsSync(ComponentDetection.componentDetectionPath));
});
test('Runs CLI', async () => {
runComponentDetection('./test');
ComponentDetection.runComponentDetection('./test');
expect(fs.existsSync(ComponentDetection.outputPath));
});
test('Parses CLI output', async () => {
getManifestsFromResults();
var manifests = await ComponentDetection.getManifestsFromResults();
expect(manifests?.length == 2);
});