Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ignore empty fixedIn arrays #739

Merged
merged 1 commit into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function constructUnfixableText(unresolved: IssueData[]) {
}
const unfixableIssuesTextArray = [chalk.bold.white('\nIssues with no direct upgrade or patch:')];
for (const issue of unresolved) {
const extraInfo = issue.fixedIn
const extraInfo = issue.fixedIn && issue.fixedIn.length
? `\n This issue was fixed in versions: ${chalk.bold(issue.fixedIn.join(', '))}`
: '\n No upgrade or patch available';
const packageNameAtVersion = chalk.bold.whiteBright(`\n ${issue.packageName}@${issue.version}\n`);
Expand Down
6 changes: 4 additions & 2 deletions test/acceptance/display-test-results.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ test('`test ruby-app` remediation displayed', async (t) => {
await snykTest('ruby-app');
} catch (error) {
const res = error.message;
t.match(res, 'Upgrade rack@1.6.5 to rack@1.6.11 to fix', 'upgrade advice displayed');
t.match(res, 'Tested 3 dependencies for known issues, found 6 issues, 8 vulnerable paths.');
t.match(res, 'Upgrade rails@5.2.3 to rails@5.2.3 to fix', 'upgrade advice displayed');
t.match(res, 'Tested 52 dependencies for known issues');
t.match(res, 'This issue was fixed in versions: 1.2.3', 'fixed in is shown');
t.match(res, 'No upgrade or patch available', 'some have no upgrade or patch');
}

snykTestStub.restore();
Expand Down