mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-30 00:00:04 +08:00
fix: Plugin install fails when preview sdk is installed (#985)
This commit is contained in:
@@ -33,14 +33,21 @@ describe('android_sdk', () => {
|
||||
|
||||
describe('sort_by_largest_numerical_suffix', () => {
|
||||
it('should return the newest version first', () => {
|
||||
const ids = ['android-24', 'android-19', 'android-27', 'android-23'];
|
||||
const sortedIds = ['android-27', 'android-24', 'android-23', 'android-19'];
|
||||
const ids = ['android-P', 'android-24', 'android-19', 'android-27', 'android-23'];
|
||||
const sortedIds = ['android-27', 'android-24', 'android-23', 'android-19', 'android-P'];
|
||||
expect(ids.sort(android_sdk.__get__('sort_by_largest_numerical_suffix'))).toEqual(sortedIds);
|
||||
});
|
||||
|
||||
it('should return 0 (no sort) if one of the versions has no number', () => {
|
||||
const ids = ['android-27', 'android-P'];
|
||||
expect(android_sdk.__get__('sort_by_largest_numerical_suffix')(ids[0], ids[1])).toBe(0);
|
||||
describe('should return release version over preview versions', () => {
|
||||
it('Test #001', () => {
|
||||
const ids = ['android-27', 'android-P'];
|
||||
expect(android_sdk.__get__('sort_by_largest_numerical_suffix')(ids[0], ids[1])).toBe(-1);
|
||||
});
|
||||
|
||||
it('Test #002', () => {
|
||||
const ids = ['android-P', 'android-27'];
|
||||
expect(android_sdk.__get__('sort_by_largest_numerical_suffix')(ids[0], ids[1])).toBe(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user