mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
android-versions@1.4.0 update in 7.1.x (add Pie)
This commit is contained in:
+28
-28
@@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
var test = require('tape')
|
||||
var android = require('..')
|
||||
const test = require('tape')
|
||||
const android = require('..')
|
||||
|
||||
test('get specific version by API level', (t) => {
|
||||
t.plan(1)
|
||||
@@ -16,7 +16,7 @@ test('getAll versions by API level', (t) => {
|
||||
test('get specific version by predicate', (t) => {
|
||||
t.plan(2)
|
||||
|
||||
var actual = android.get((version) => {
|
||||
let actual = android.get((version) => {
|
||||
return version.name.indexOf("on") !== -1
|
||||
})
|
||||
t.equal(actual.name, "Donut")
|
||||
@@ -30,7 +30,7 @@ test('get specific version by predicate', (t) => {
|
||||
test('getAll versions by predicate', (t) => {
|
||||
t.plan(3)
|
||||
|
||||
var actual = android.getAll((version) => {
|
||||
let actual = android.getAll((version) => {
|
||||
return version.name.indexOf("on") !== -1
|
||||
}).map((version) => version.name)
|
||||
t.deepEqual(actual, ["Donut", "Honeycomb", "Honeycomb", "Honeycomb"])
|
||||
@@ -43,7 +43,7 @@ test('getAll versions by predicate', (t) => {
|
||||
actual = android.getAll((version) => {
|
||||
return version.api > 22
|
||||
}).map((version) => version.versionCode)
|
||||
t.deepEqual(actual, ["M", "N", "N_MR1", "O", "O_MR1"])
|
||||
t.deepEqual(actual, ["M", "N", "N_MR1", "O", "O_MR1", "P"])
|
||||
})
|
||||
|
||||
test('get version by semantic version', (t) => {
|
||||
@@ -54,32 +54,31 @@ test('get version by semantic version', (t) => {
|
||||
t.equal(android.get("2.3.3").versionCode, android.GINGERBREAD_MR1.versionCode)
|
||||
})
|
||||
|
||||
test('support major version only', (t) => {
|
||||
t.plan(2)
|
||||
t.equal(android.get("9.0").versionCode, android.P.versionCode)
|
||||
t.equal(android.get("9.0.0").versionCode, android.P.versionCode)
|
||||
})
|
||||
|
||||
test('support version ranges', (t) => {
|
||||
t.plan(7);
|
||||
t.equal(android.get("4.4").versionCode, android.KITKAT.versionCode);
|
||||
t.equal(android.get("4.4.0").versionCode, android.KITKAT.versionCode);
|
||||
t.equal(android.get("4.4.1").versionCode, android.KITKAT.versionCode);
|
||||
t.equal(android.get("4.4.2").versionCode, android.KITKAT.versionCode);
|
||||
t.equal(android.get("4.4.3").versionCode, android.KITKAT.versionCode);
|
||||
t.equal(android.get("4.4.4").versionCode, android.KITKAT.versionCode);
|
||||
t.equal(android.get("4.4.5"), null);
|
||||
t.plan(7)
|
||||
let tests = [ "4.4", "4.4.0", "4.4.1", "4.4.2", "4.4.3", "4.4.4" ]
|
||||
tests.forEach((versionCode) => {
|
||||
t.equal(android.get(versionCode).versionCode, android.KITKAT.versionCode)
|
||||
})
|
||||
t.equal(android.get("4.4.5"), null)
|
||||
})
|
||||
|
||||
test('support x-ranges', (t) => {
|
||||
t.plan(12);
|
||||
t.equal(android.get("4.1").versionCode, android.JELLY_BEAN.versionCode);
|
||||
t.equal(android.get("4.1.0").versionCode, android.JELLY_BEAN.versionCode);
|
||||
t.equal(android.get("4.1.1").versionCode, android.JELLY_BEAN.versionCode);
|
||||
t.equal(android.get("4.1.2").versionCode, android.JELLY_BEAN.versionCode);
|
||||
t.equal(android.get("4.1.3").versionCode, android.JELLY_BEAN.versionCode);
|
||||
t.equal(android.get("4.1.4").versionCode, android.JELLY_BEAN.versionCode);
|
||||
t.equal(android.get("4.1.5").versionCode, android.JELLY_BEAN.versionCode);
|
||||
t.equal(android.get("4.1.6").versionCode, android.JELLY_BEAN.versionCode);
|
||||
t.equal(android.get("4.1.7").versionCode, android.JELLY_BEAN.versionCode);
|
||||
t.equal(android.get("4.1.8").versionCode, android.JELLY_BEAN.versionCode);
|
||||
t.equal(android.get("4.1.9").versionCode, android.JELLY_BEAN.versionCode);
|
||||
t.equal(android.get("4.1.10").versionCode, android.JELLY_BEAN.versionCode);
|
||||
});
|
||||
t.plan(12)
|
||||
let tests = [
|
||||
"4.1", "4.1.0", "4.1.1", "4.1.2", "4.1.3", "4.1.4",
|
||||
"4.1.5", "4.1.6", "4.1.7", "4.1.8", "4.1.9", "4.1.10"
|
||||
]
|
||||
tests.forEach((versionCode) => {
|
||||
t.equal(android.get(versionCode).versionCode, android.JELLY_BEAN.versionCode)
|
||||
})
|
||||
})
|
||||
|
||||
test('access version codes object', (t) => {
|
||||
t.plan(1)
|
||||
@@ -87,7 +86,7 @@ test('access version codes object', (t) => {
|
||||
})
|
||||
|
||||
test('access specific versions directly', (t) => {
|
||||
t.plan(27)
|
||||
t.plan(28)
|
||||
t.ok(android.BASE)
|
||||
t.ok(android.BASE_1_1)
|
||||
t.ok(android.CUPCAKE)
|
||||
@@ -115,4 +114,5 @@ test('access specific versions directly', (t) => {
|
||||
t.ok(android.N_MR1)
|
||||
t.ok(android.O)
|
||||
t.ok(android.O_MR1)
|
||||
t.ok(android.P)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user