Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-11811 - Updated travis settings for CocoaPods testing #489

Closed
wants to merge 13 commits into from
20 changes: 13 additions & 7 deletions .travis.yml
@@ -1,12 +1,18 @@
language: node_js
language: objective-c
cache: cocoapods
sudo: false
osx_image: xcode7.3
rvm: 2.2.0
git:
depth: 10
node_js:
- "0.10"
- "0.12"
- "4"
- "6"
before_install:
- npm cache clean -f
- npm install -g n
- n stable
- node --version
- gem install activesupport -v '4.2.6'
- gem install cocoapods -v '1.0.1'
- pod setup
install:
- git clone https://github.com/apache/cordova-js --depth 10
- cd cordova-lib
Expand All @@ -25,4 +31,4 @@ install:
script:
- "(cd ../cordova-common && npm test)"
- "(cd ../cordova-fetch && npm test)"
- "npm run ci"
- "npm run ci-ios"
8 changes: 5 additions & 3 deletions cordova-lib/package.json
Expand Up @@ -54,10 +54,12 @@
"test": "npm run jshint && npm run jasmine",
"test-ios": "npm run test && npm run jasmine-ios",
"ci": "npm run jshint && npm run cover && codecov",
"jshint": "jshint src spec-cordova spec-plugman",
"ci-ios": "npm run jshint && npm run cover-ios && codecov",
"jshint": "jshint src spec-cordova spec-plugman spec-cordova-ios",
"jasmine": "jasmine-node --captureExceptions --color spec-plugman spec-cordova",
"jasmine-ios": "jasmine-node --captureExceptions --color spec-cordova/platform.spec.ios.js --matchall",
"cover": "istanbul cover --root src --print detail node_modules/jasmine-node/bin/jasmine-node -- spec-cordova spec-plugman"
"jasmine-ios": "jasmine-node --captureExceptions --color spec-cordova-ios",
"cover": "istanbul cover --root src --print detail node_modules/.bin/jasmine-node -- spec-cordova spec-plugman",
"cover-ios": "istanbul cover --root src --print detail node_modules/.bin/jasmine-node -- spec-cordova spec-plugman spec-cordova-ios"
},
"contributors": [
{
Expand Down
Expand Up @@ -17,7 +17,7 @@
under the License.
*/

var helpers = require('./helpers'),
var helpers = require('../spec-cordova/helpers'),
path = require('path'),
fs = require('fs'),
shell = require('shelljs'),
Expand Down Expand Up @@ -45,7 +45,6 @@ describe('cocoapod plugin add and rm end-to-end', function () {
});

it('installs and uninstalls plugin depending on new pod and existing pod', function(done) {

cordova.raw.create('hello4')
.then(function() {
process.chdir(project);
Expand All @@ -55,6 +54,7 @@ describe('cocoapod plugin add and rm end-to-end', function () {
return cordova.raw.plugin('add', samplePlugin);
})
.then(function() {

podfile = path.resolve('./platforms/ios/Podfile');
podsJSON = path.resolve('./platforms/ios/pods.json');
workspace = path.resolve('./platforms/ios/HelloCordova.xcworkspace');
Expand Down Expand Up @@ -83,6 +83,7 @@ describe('cocoapod plugin add and rm end-to-end', function () {
return cordova.raw.plugin('add', overlappingDependencyPlugin);
})
.then(function() {

var podfileContent = fs.readFileSync(podfile, {'encoding' : 'utf8'});
var numberOfTimesAFNetworkingIsInPodfile = podfileContent.match(/AFNetworking/g || []).length;

Expand All @@ -102,6 +103,7 @@ describe('cocoapod plugin add and rm end-to-end', function () {
return cordova.raw.plugin('rm','sample-cocoapod-plugin-overlapping-dependency');
})
.then(function() {

//expect only AFNetworking
var podfileContent = fs.readFileSync(podfile, {'encoding' : 'utf8'});

Expand All @@ -117,6 +119,7 @@ describe('cocoapod plugin add and rm end-to-end', function () {
return cordova.raw.plugin('rm', 'sample-cordova-plugin-cocoapod-dependent');
})
.then(function() {

//expect no pods
delete require.cache[require.resolve(podfile)];
var podfileContent = fs.readFileSync(podfile, {'encoding' : 'utf8'});
Expand Down