diff --git a/.gitignore b/.gitignore index 02f1b08..dffa296 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules/** tags .zedstate /www/umd-tough-cookie.js +/temp diff --git a/.npmignore b/.npmignore index 79fdf36..c187208 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,4 @@ tags .zedstate +/scripts +/temp diff --git a/package.json b/package.json index 1c4c3ce..3aedbb6 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "Cordova / Phonegap plugin for communicating with HTTP servers using SSL pinning", "scripts": { "build": "cp node_modules/umd-tough-cookie/lib/umd-tough-cookie.js www/umd-tough-cookie.js", - "prepublish": "npm run build" + "prepublish": "npm run build", + "test": "npm run build && ./scripts/test-installation.sh" }, "cordova": { "id": "cordova-plugin-advanced-http", @@ -50,6 +51,7 @@ }, "homepage": "https://github.com/silkimen/cordova-plugin-advanced-http#readme", "devDependencies": { + "cordova": "7.0.1", "umd-tough-cookie": "2.3.2" } } diff --git a/scripts/test-installation.sh b/scripts/test-installation.sh new file mode 100755 index 0000000..7e57faf --- /dev/null +++ b/scripts/test-installation.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -e + +ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/.. +CDV=$ROOT/node_modules/.bin/cordova + +rm -rf $ROOT/temp +$CDV create $ROOT/temp +cd $ROOT/temp +$CDV platforms add android +$CDV platforms add ios +$CDV plugins add $ROOT diff --git a/travis.yml b/travis.yml new file mode 100644 index 0000000..5c64a57 --- /dev/null +++ b/travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: +- 'lts/*'