Skip to content

Commit

Permalink
fix(minVersionBump): swapped minor/major
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed Jul 30, 2020
1 parent 35c1992 commit 56fd4ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@uniswap/token-lists",
"author": "Moody Salem",
"version": "1.0.0-beta.10",
"version": "1.0.0-beta.11",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/minVersionBump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export function minVersionBump(
updatedList: TokenInfo[]
): VersionUpgrade {
const diff = diffTokenLists(baseList, updatedList);
if (diff.added.length > 0) return VersionUpgrade.MAJOR;
if (diff.removed.length > 0) return VersionUpgrade.MINOR;
if (diff.removed.length > 0) return VersionUpgrade.MAJOR;
if (diff.added.length > 0) return VersionUpgrade.MINOR;
if (Object.keys(diff.changed).length > 0) return VersionUpgrade.PATCH;
return VersionUpgrade.NONE;
}
8 changes: 4 additions & 4 deletions test/minVersionBump.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ describe('#minVersionBump', () => {
VersionUpgrade.PATCH
);
});
it('minor for remove only', () => {
expect(minVersionBump([tokenA], [])).toBe(VersionUpgrade.MINOR);
it('major for remove', () => {
expect(minVersionBump([tokenA], [])).toBe(VersionUpgrade.MAJOR);
});
it('major for add', () => {
expect(minVersionBump([], [tokenA])).toBe(VersionUpgrade.MAJOR);
it('minor for add', () => {
expect(minVersionBump([], [tokenA])).toBe(VersionUpgrade.MINOR);
});
it('major for add/remove', () => {
expect(minVersionBump([tokenB], [tokenA])).toBe(VersionUpgrade.MAJOR);
Expand Down

0 comments on commit 56fd4ee

Please sign in to comment.