Place current release at the top of version dropdown in Manage Packages dialog. (#12884)

* Also improved sorting for version numbers with non-numeric components.
This commit is contained in:
Cory Rivera
2020-10-12 12:20:33 -07:00
committed by GitHub
parent f61ffae15c
commit 108891ba2e
3 changed files with 37 additions and 9 deletions

View File

@@ -131,6 +131,12 @@ describe('Utils Tests', function () {
const randomSorted = ['0.1', '1.0.0', '1.0.1', '42', '100.0'];
should(utils.sortPackageVersions(random)).deepEqual(randomSorted);
});
it('versions with non-numeric components', () => {
const random = ['1.0.1h', '1.0.0', '42', '1.0.1b', '100.0', '0.1', '1.0.1'];
const randomSorted = ['0.1', '1.0.0', '1.0.1', '1.0.1b', '1.0.1h', '42', '100.0'];
should(utils.sortPackageVersions(random)).deepEqual(randomSorted);
});
});
describe('executeBufferedCommand', () => {