test(android): fix tests to use cordova-android 10.x default https scheme (#518)
* test(android): fix tests to run on cordova-android 10.x that defaults to https scheme
* style: add cordova to lint globals
diff --git a/.eslintrc.yml b/.eslintrc.yml
index 902048d..b6f153d 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -1,6 +1,10 @@
root: true
extends: '@cordova/eslint-config/browser'
+globals:
+ cordova: true
overrides:
- - files: [tests/**/*.js]
- extends: '@cordova/eslint-config/node-tests'
+ - files: [tests/**/*.js]
+ extends: '@cordova/eslint-config/node-tests'
+ globals:
+ cordova: true
diff --git a/tests/tests.js b/tests/tests.js
index 80862c3..b442cd9 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -3435,9 +3435,14 @@
/* These specs verify that FileEntries have a toNativeURL method
* which appears to be sane.
*/
- var pathExpect = cordova.platformId === 'windowsphone' ? '//nativ' : 'file://'; // eslint-disable-line no-undef
+ var pathExpect = 'file://';
- if (isChrome) {
+ if (cordova.platformId === 'android') {
+ // Starting from Cordova-Android 10.x, the app content is served from the https scheme
+ pathExpect = 'https://';
+ } else if (cordova.platformId === 'windowsphone') {
+ pathExpect = '//nativ';
+ } else if (isChrome) {
pathExpect = 'filesystem:http://';
}