Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@amplitude/analytics-node": "^1.5.54",
"@apollo/client": "^4.1.9",
"@cyclonedx/cdxgen": "^12.2.0",
"@herodevs/eol-shared": "github:herodevs/eol-shared#v0.1.19",
"@herodevs/eol-shared": "github:herodevs/eol-shared#v0.1.20",
"@inquirer/prompts": "^8.0.2",
"@oclif/core": "^4.10.5",
"@oclif/plugin-help": "^6.2.32",
Expand Down
1 change: 1 addition & 0 deletions src/api/gql-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ query GetEolReport($input: GetEolReportInput) {
}
}
}
remediations
}
page
totalRecords
Expand Down
27 changes: 27 additions & 0 deletions test/service/file.svc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,33 @@ describe('file.svc', () => {
expect(outputPath.includes(tempDir)).toBe(true);
});

it('should preserve per-component remediations in the saved report', async () => {
tempDir = createTempDir();

const reportWithRemediations: EolReport = {
...mockReport,
components: [
{
purl: 'pkg:npm/bootstrap@3.1.1',
metadata: null,
remediations: [
{
type: 'nes_available',
description: 'Secured, supported, drop-in replacement',
action: { type: 'direct', url: 'https://www.herodevs.com/support/bootstrap-nes' },
target: { purl: 'pkg:npm/bootstrap@3.1.1', version: '3.1.1' },
},
],
},
],
};

const outputPath = saveArtifactToFile(tempDir, { kind: 'report', payload: reportWithRemediations });

const parsed = JSON.parse(fs.readFileSync(outputPath, 'utf8'));
expect(parsed.components[0].remediations).toEqual(reportWithRemediations.components[0].remediations);
});

it('should save report to a custom path', async () => {
tempDir = createTempDir();
const customDir = join(tempDir, 'nested');
Expand Down
Loading