diff --git a/.gitignore b/.gitignore
index 9ca4c2b..0c2a6ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
node_modules/**
tags
.zedstate
+npm-debug.log
/temp
diff --git a/.travis.yml b/.travis.yml
index 38b4b1f..35ba419 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -32,7 +32,8 @@ install:
script:
- travis_wait scripts/build-test-app.sh
- scripts/upload-artifact.sh
-- scripts/test.sh --ios --emulator
+- npm run testjs
+- scripts/test-app.sh --ios --emulator
after_success:
diff --git a/package.json b/package.json
index a23a6c3..3de5d1f 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,9 @@
"version": "1.6.2",
"description": "Cordova / Phonegap plugin for communicating with HTTP servers using SSL pinning",
"scripts": {
- "test": "./scripts/build-test-app.sh && ./scripts/test.sh --ios --emulator",
+ "testapp": "./scripts/build-test-app.sh && ./scripts/test-app.sh --ios --emulator",
+ "testjs": "mocha ./test/js-mocha-specs.js",
+ "test": "npm run testjs && npm run testapp",
"release": "npm run test && ./scripts/release.sh"
},
"cordova": {
@@ -55,6 +57,7 @@
"colors": "1.1.2",
"cordova": "7.0.1",
"mocha": "4.0.0",
+ "mock-require": "2.0.2",
"mz": "2.7.0",
"umd-tough-cookie": "2.3.2",
"wd": "1.4.1",
diff --git a/scripts/build-test-app.sh b/scripts/build-test-app.sh
index ef062fa..441df5c 100755
--- a/scripts/build-test-app.sh
+++ b/scripts/build-test-app.sh
@@ -9,7 +9,7 @@ CDV=$ROOT/node_modules/.bin/cordova
rm -rf $ROOT/temp
mkdir $ROOT/temp
cp -r $ROOT/test/app-template/ $ROOT/temp/
-cp $ROOT/test/test-definitions.js $ROOT/temp/www/js/
+cp $ROOT/test/app-test-definitions.js $ROOT/temp/www/js/
cd $ROOT/temp
$CDV prepare
$CDV plugins add $ROOT
diff --git a/scripts/test.sh b/scripts/test-app.sh
similarity index 63%
rename from scripts/test.sh
rename to scripts/test-app.sh
index 15404ba..5957d2c 100755
--- a/scripts/test.sh
+++ b/scripts/test-app.sh
@@ -4,5 +4,5 @@ set -e
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/..
pushd $ROOT
-./node_modules/.bin/mocha ./test/mocha-specs/test.js "$@"
+./node_modules/.bin/mocha ./test/app-mocha-specs/test.js "$@"
popd
diff --git a/test/mocha-specs/helpers/apps.js b/test/app-mocha-specs/helpers/apps.js
similarity index 100%
rename from test/mocha-specs/helpers/apps.js
rename to test/app-mocha-specs/helpers/apps.js
diff --git a/test/mocha-specs/helpers/caps.js b/test/app-mocha-specs/helpers/caps.js
similarity index 100%
rename from test/mocha-specs/helpers/caps.js
rename to test/app-mocha-specs/helpers/caps.js
diff --git a/test/mocha-specs/helpers/logging.js b/test/app-mocha-specs/helpers/logging.js
similarity index 100%
rename from test/mocha-specs/helpers/logging.js
rename to test/app-mocha-specs/helpers/logging.js
diff --git a/test/mocha-specs/helpers/server.js b/test/app-mocha-specs/helpers/server.js
similarity index 100%
rename from test/mocha-specs/helpers/server.js
rename to test/app-mocha-specs/helpers/server.js
diff --git a/test/mocha-specs/helpers/setup.js b/test/app-mocha-specs/helpers/setup.js
similarity index 100%
rename from test/mocha-specs/helpers/setup.js
rename to test/app-mocha-specs/helpers/setup.js
diff --git a/test/mocha-specs/test.js b/test/app-mocha-specs/test.js
similarity index 97%
rename from test/mocha-specs/test.js
rename to test/app-mocha-specs/test.js
index 6ae2ce2..09049dc 100644
--- a/test/mocha-specs/test.js
+++ b/test/app-mocha-specs/test.js
@@ -4,7 +4,7 @@ const wd = require('wd');
const apps = require('./helpers/apps');
const caps = Object.assign({}, require('./helpers/caps'));
const serverConfig = require('./helpers/server');
-const testDefinitions = require('../test-definitions');
+const testDefinitions = require('../app-test-definitions');
const pkgjson = require('../../package.json');
describe('Advanced HTTP', function() {
diff --git a/test/app-template/www/index.html b/test/app-template/www/index.html
index ff105fe..fa9273a 100644
--- a/test/app-template/www/index.html
+++ b/test/app-template/www/index.html
@@ -14,7 +14,7 @@
-
+