Add platforms used during tests as devDependencies (#207)

diff --git a/.travis.yml b/.travis.yml
index f73bcdf..fdc2e3f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,10 +9,4 @@
   - 12
 
 install:
-  - cd ..
-  - git clone https://github.com/apache/cordova-android --depth 10
-  - git clone https://github.com/apache/cordova-ios --depth 10
-  - git clone https://github.com/apache/cordova-windows --depth 10
-  - git clone https://github.com/apache/cordova-browser --depth 10
-  - cd cordova-js
   - npm install
diff --git a/appveyor.yml b/appveyor.yml
index 9032c6b..8c09bfd 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -8,13 +8,6 @@
 
 install:
   - ps: Install-Product node $env:nodejs_version
-
-  - cd ..
-  - git clone https://github.com/apache/cordova-android --depth 10
-  - git clone https://github.com/apache/cordova-ios --depth 10
-  - git clone https://github.com/apache/cordova-windows --depth 10
-  - git clone https://github.com/apache/cordova-browser --depth 10
-  - cd cordova-js
   - npm install
 
 build: off
diff --git a/package.json b/package.json
index 5d55ae4..e088c30 100644
--- a/package.json
+++ b/package.json
@@ -74,6 +74,8 @@
     "globby": "^9.2.0"
   },
   "devDependencies": {
+    "cordova-android": "^8.0.0",
+    "cordova-ios": "^5.0.0",
     "eslint": "^5.16.0",
     "eslint-config-semistandard": "^13.0.0",
     "eslint-config-standard": "^12.0.0",
diff --git a/test/build.js b/test/build.js
index f03236a..5c2a007 100755
--- a/test/build.js
+++ b/test/build.js
@@ -25,11 +25,9 @@
 }
 
 function collectTestBuildModules () {
-    const pkgRoot = path.join(__dirname, '..');
-
     // Add platform-specific modules that have tests to the test bundle.
     const platformModules = ['android', 'ios'].map(platform => {
-        const platformPath = path.resolve(pkgRoot, `../cordova-${platform}`);
+        const platformPath = path.dirname(require.resolve(`cordova-${platform}/package`));
         const modulePath = path.join(platformPath, 'cordova-js-src');
         const modules = collectModules(modulePath);