add travis test
MODIFY
.travis.yml
.travis.yml
@@ -2,24 +2,20 @@ sudo: false
env:
global:
- - NODE_VERSION="9.11.2"
+ - NODE_VERSION="6.0.0"
- ANDROID_API="27"
- ANDROID_BUILD_TOOLS="27.0.3"
notifications:
email: false
-branches:
- only:
- - master
-
matrix:
include:
- os: linux
- env: CORDOVA_VERSION="8.0.0" CORDOVA_PLATFORM="browser"
+ env: CORDOVA_VERSION="8.1.2" CORDOVA_PLATFORM="browser"
language: node_js
node_js: '${NODE_VERSION}'
- - env: CORDOVA_VERSION="8.0.0" CORDOVA_PLATFORM="android-7.0"
+ - env: CORDOVA_VERSION="8.1.2" CORDOVA_PLATFORM="android-7.0"
os: linux
node_js: '${NODE_VERSION}'
language: android

ADD
tests/package.json
+{
+ "name": "cordova-plugin-googlemaps-tests",
+ "version": "0.0.3-dev",
+ "description": "",
+ "cordova": {
+ "id": "cordova-plugin-googlemaps-tests",
+ "platforms": []
+ },
+ "keywords": [
+ "ecosystem:cordova"
+ ],
+ "author": "",
+ "license": "Apache 2.0"
+}

ADD
tests/plugin.xml
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
+ xmlns:rim="http://www.blackberry.com/ns/widgets"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ id="cordova-plugin-googlemaps-tests"
+ version="2.5.0-beta-20181016-1830-dev">
+ <name>Cordova Geolocation Plugin Tests</name>
+ <license>Apache 2.0</license>
+
+ <js-module src="tests.js" name="tests">
+ </js-module>
+</plugin>

ADD
tests/tests.js
+exports.defineAutoTests = function () {
+
+ describe('install check', function () {
+
+ it('plugin.google.maps should exist', function () {
+ expect(plugin.google.maps).toBeDefined();
+ });
+
+ });
+
+};

ADD
tests/travis.sh
+#!/bin/bash
+set -o nounset
+set -o errexit
+
+# run tests appropriate for platform
+#if [[ "${CORDOVA_PLATFORM}" == "browser" ]]; then
+# npm run test:browser
+#fi
+if [[ "${CORDOVA_PLATFORM}" == "ios" ]]; then
+ sudo gem install cocoapods
+ npm install -g ios-sim ios-deploy
+ npm run test:ios
+fi
+echo "CORDOVA_PLATFORM=${CORDOVA_PLATFORM}"
+echo "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}"
+
+if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
+ echo "y" | sdkmanager "platforms;android-${ANDROID_API}"; > /dev/null;
+ echo "y" | android update sdk -a --no-ui --filter android-${ANDROID_API} > /dev/null
+ echo "y" | android update sdk -a --no-ui --filter sys-img-armeabi-v7a-android-${ANDROID_API} > /dev/null
+ echo no | android create avd --force -n test -t android-${ANDROID_API} --abi armeabi-v7a > /dev/null
+ emulator -avd test -no-skin -no-window &
+ android-wait-for-emulator
+ adb shell input keyevent 82 &
+ adb wait-for-device get-serialno
+ npm run test:android
+fi

add travis test