Skip to content

Commit

Permalink
Merge pull request #3056 from snyk/fix/target-branch
Browse files Browse the repository at this point in the history
fix: remove target.branch
  • Loading branch information
aron committed Mar 25, 2022
2 parents 643dba5 + 810b6b8 commit 0064077
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/iac/envelope-formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function convertIacResultToScanResult(
target:
Object.keys(gitTarget).length === 0
? { name: iacResult.projectName }
: { ...gitTarget, branch: 'master' },
: { remoteUrl: gitTarget.remoteUrl },
policy: policy?.toString() ?? '',
};
}
1 change: 0 additions & 1 deletion test/jest/acceptance/iac/cli-share-results.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ describe('CLI Share Results', () => {
policy: '',
name: 'arm',
target: {
branch: 'master',
remoteUrl: 'http://github.com/snyk/cli.git',
},
},
Expand Down
2 changes: 0 additions & 2 deletions test/jest/unit/iac/cli-share-results.fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ export const expectedEnvelopeFormatterResults = [
policy: '',
target: {
remoteUrl: 'http://github.com/snyk/cli.git',
branch: 'master',
},
},
{
Expand Down Expand Up @@ -163,7 +162,6 @@ export const expectedEnvelopeFormatterResults = [
policy: '',
target: {
remoteUrl: 'http://github.com/snyk/cli.git',
branch: 'master',
},
},
];
Expand Down
2 changes: 2 additions & 0 deletions test/jest/unit/iac/cli-share-results.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe('CLI Share Results', () => {
firstCallResult,
secondCallResult,
] = envelopeFormattersSpy.mock.results;

expect(firstCallResult.value).toEqual(expectedEnvelopeFormatterResults[0]);
expect(secondCallResult.value).toEqual(expectedEnvelopeFormatterResults[1]);
});
Expand All @@ -57,6 +58,7 @@ describe('CLI Share Results', () => {
firstCallResult,
secondCallResult,
] = envelopeFormattersSpy.mock.results;

expect(firstCallResult.value).toEqual(
expectedEnvelopeFormatterResultsWithPolicy[0],
);
Expand Down

0 comments on commit 0064077

Please sign in to comment.