-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the
update-type
is missing for some reason, calculate it from th…
…e versions
- Loading branch information
Showing
3 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,6 @@ test('it returns the updated dependency information when there is a yaml fragmen | |
'updated-dependencies:\n' + | ||
'- dependency-name: coffee-rails\n' + | ||
' dependency-type: direct:production\n' + | ||
' update-type: version-update:semver-minor\n' + | ||
'...\n' + | ||
'\n' + | ||
'Signed-off-by: dependabot[bot] <[email protected]>' | ||
|
@@ -194,3 +193,19 @@ test('it properly handles dependencies which contain slashes', async () => { | |
expect(updatedDependencies[0].ghsaId).toEqual('') | ||
expect(updatedDependencies[0].cvss).toEqual(0) | ||
}) | ||
|
||
test('calculateUpdateType should handle all paths', () => { | ||
expect(updateMetadata.calculateUpdateType('', '')).toEqual('') | ||
expect(updateMetadata.calculateUpdateType('', '1')).toEqual('') | ||
expect(updateMetadata.calculateUpdateType('1', '')).toEqual('') | ||
expect(updateMetadata.calculateUpdateType('1.1.1', '1.1.1')).toEqual('') | ||
expect(updateMetadata.calculateUpdateType('1', '2')).toEqual('version-update:semver-major') | ||
expect(updateMetadata.calculateUpdateType('1.2.2', '2.2.2')).toEqual('version-update:semver-major') | ||
expect(updateMetadata.calculateUpdateType('1.1', '1')).toEqual('version-update:semver-minor') | ||
expect(updateMetadata.calculateUpdateType('1', '1.1')).toEqual('version-update:semver-minor') | ||
expect(updateMetadata.calculateUpdateType('1.2.1', '1.1.1')).toEqual('version-update:semver-minor') | ||
expect(updateMetadata.calculateUpdateType('1.1.1', '1.1')).toEqual('version-update:semver-patch') | ||
expect(updateMetadata.calculateUpdateType('1.1', '1.1.1')).toEqual('version-update:semver-patch') | ||
expect(updateMetadata.calculateUpdateType('1.1.1', '1.1.2')).toEqual('version-update:semver-patch') | ||
expect(updateMetadata.calculateUpdateType('1.1.1.1', '1.1.1.2')).toEqual('version-update:semver-patch') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters