chore(travis): re-enable jshint

This commit is contained in:
Andrew Joslin
2014-05-08 09:10:27 -06:00
parent 6facb8cb86
commit 95d1aea4f1
27 changed files with 197 additions and 194 deletions

View File

@@ -127,7 +127,7 @@ describe('$ionicScroll Controller', function() {
it('should forget on $viewHistory.viewBack after $viewContentLoaded', inject(function($rootScope, $timeout) {
var historyData = { viewId: 'foo' };
setup();
spyOn($rootScope, '$on').andCallThrough();;
spyOn($rootScope, '$on').andCallThrough();
scope.$broadcast('$viewContentLoaded', historyData);
$timeout.flush();
expect(scope.$on).toHaveBeenCalledWith('$viewHistory.viewBack', jasmine.any(Function));

View File

@@ -105,7 +105,7 @@ describe('ionNavBar', function() {
ctrl.setTitle('baz');
expect($scope.title).toBe('baz');
expect($scope.oldTitle).toBe('bar');
})
});
it('should getTitle', function() {
var ctrl = setup();

View File

@@ -53,7 +53,7 @@ describe('ionRefresher directive', function() {
expect(el.controller('$ionicScroll')._setRefresher.callCount).toBe(1);
expect(el.controller('$ionicScroll')._setRefresher).toHaveBeenCalledWith(
el.scope(), el[0]
)
);
});
it('should listen for scroll.refreshComplete', function() {

View File

@@ -92,19 +92,19 @@ describe('Ionic Angular Side Menu', function() {
expect(ctrl.isDraggableTarget(e)).toBe(false);
e.target.isContentEditable = false;
e.target.dataset.preventScroll = true
e.target.dataset.preventScroll = true;
expect(ctrl.isDraggableTarget(e)).toBe(false);
e.target.isContentEditable = false;
e.target.dataset = undefined;
e.target.getAttribute = function(val){
return (val == 'data-prevent-default' ? 'true' : undefined);
}
};
expect(ctrl.isDraggableTarget(e)).toBe(false);
e.target.getAttribute = function(){
return null;
}
};
expect(ctrl.isDraggableTarget(e)).toBe(true);
}));
@@ -195,8 +195,8 @@ describe('menuToggle directive', function() {
var toggleLeftSpy, toggleRightSpy;
function setup(side) {
var el = angular.element('<div menu-toggle="' + (side||'') + '">');
toggleLeftSpy = jasmine.createSpy('toggleLeft')
toggleRightSpy = jasmine.createSpy('toggleRight')
toggleLeftSpy = jasmine.createSpy('toggleLeft');
toggleRightSpy = jasmine.createSpy('toggleRight');
el.data('$ionSideMenusController', {
toggleLeft: toggleLeftSpy,
toggleRight: toggleRightSpy
@@ -242,7 +242,7 @@ describe('menuClose directive', function() {
}));
it('should close on click', inject(function($compile, $rootScope) {
var el = angular.element('<div menu-close>');
var closeSpy = jasmine.createSpy('sideMenuClose')
var closeSpy = jasmine.createSpy('sideMenuClose');
el.data('$ionSideMenusController', {
close: closeSpy
});

View File

@@ -12,21 +12,21 @@ describe('Ionic Angular Slide Box', function() {
rootScope = $rootScope;
compile = $compile;
el = $compile('<ion-slide-box>\
<ion-slide>\
<div class="box blue">\
<h1>BLUE {{slideBox.slideIndex}}</h1>\
</div>\
</ion-slide>\
<ion-slide>\
<div class="box yellow">\
<h1>YELLOW {{slideBox.slideIndex}}</h1>\
</div>\
</ion-slide>\
<ion-slide>\
<div class="box pink"><h1>PINK {{slideBox.slideIndex}}</h1></div>\
</ion-slide>\
</ion-slide-box>')($rootScope);
el = $compile('<ion-slide-box>' +
'<ion-slide>' +
'<div class="box blue">' +
'<h1>BLUE {{slideBox.slideIndex}}</h1>' +
'</div>' +
'</ion-slide>' +
'<ion-slide>' +
'<div class="box yellow">' +
'<h1>YELLOW {{slideBox.slideIndex}}</h1>' +
'</div>' +
'</ion-slide>' +
'<ion-slide>' +
'<div class="box pink"><h1>PINK {{slideBox.slideIndex}}</h1></div>' +
'</ion-slide>' +
'</ion-slide-box>')($rootScope);
}));
it('should register with $ionicSlideBoxDelegate', inject(function($compile, $rootScope, $ionicSlideBoxDelegate) {
@@ -50,21 +50,21 @@ describe('ionSlideBox with active slide', function() {
beforeEach(module('ionic'));
it('Should set initial active slide', inject(function($ionicSlideBoxDelegate, $rootScope, $compile) {
el = $compile('<ion-slide-box active-slide="2">\
<ion-slide>\
<div class="box blue">\
<h1>BLUE {{slideBox.slideIndex}}</h1>\
</div>\
</ion-slide>\
<ion-slide>\
<div class="box yellow">\
<h1>YELLOW {{slideBox.slideIndex}}</h1>\
</div>\
</ion-slide>\
<ion-slide>\
<div class="box pink"><h1>PINK {{slideBox.slideIndex}}</h1></div>\
</ion-slide>\
</ion-slide-box>')($rootScope.$new());
el = $compile('<ion-slide-box active-slide="2">' +
'<ion-slide>' +
'<div class="box blue">' +
'<h1>BLUE {{slideBox.slideIndex}}</h1>' +
'</div>' +
'</ion-slide>' +
'<ion-slide>' +
'<div class="box yellow">' +
'<h1>YELLOW {{slideBox.slideIndex}}</h1>' +
'</div>' +
'</ion-slide>' +
'<ion-slide>' +
'<div class="box pink"><h1>PINK {{slideBox.slideIndex}}</h1></div>' +
'</ion-slide>' +
'</ion-slide-box>')($rootScope.$new());
var scope = el.scope();
scope.$apply();

View File

@@ -69,7 +69,7 @@ describe('tabs', function() {
ctrl.remove(tab1);
expect(ctrl.selectedTab()).toBe(tab2);
expect(ctrl.tabs.indexOf(tab1)).toBe(-1);
ctrl.remove(tab2)
ctrl.remove(tab2);
expect(ctrl.selectedTab()).toBe(null);
expect(ctrl.tabs.indexOf(tab2)).toBe(-1);
expect(ctrl.tabs.length).toBe(0);

View File

@@ -36,7 +36,7 @@ describe('Ionic Toggle', function() {
// Not disabled, we can toggle
expect(toggle.val()).toBe(false);
ionic.trigger('click', {target: label})
ionic.trigger('click', {target: label});
expect(toggle.val()).toBe(true);
// Disable it
@@ -45,7 +45,7 @@ describe('Ionic Toggle', function() {
expect(input.getAttribute('disabled')).toBe('disabled');
// We shouldn't be able to toggle it now
ionic.trigger('click', {target: label})
ionic.trigger('click', {target: label});
expect(toggle.val()).toBe(true);
// Re-enable it
@@ -53,7 +53,7 @@ describe('Ionic Toggle', function() {
rootScope.$apply();
// Should be able to toggle it now
ionic.trigger('click', {target: label})
ionic.trigger('click', {target: label});
expect(toggle.val()).toBe(false);
expect(input.getAttribute('disabled')).not.toBe('disabled');
});
@@ -62,9 +62,9 @@ describe('Ionic Toggle', function() {
var toggle = el.isolateScope().toggle;
var label = el[0].querySelector('label');
expect(toggle.val()).toBe(false);
ionic.trigger('click', {target: label})
ionic.trigger('click', {target: label});
expect(toggle.val()).toBe(true);
ionic.trigger('click', {target: label})
ionic.trigger('click', {target: label});
expect(toggle.val()).toBe(false);
});

View File

@@ -127,7 +127,7 @@ describe('DelegateFactory', function() {
expect(result).toBe('a1');
instance1.a.reset();
var result = delegate.$getByHandle('2').a(2,3,4);
result = delegate.$getByHandle('2').a(2,3,4);
expect(instance2.a).toHaveBeenCalledWith(2,3,4);
expect(instance1.a).not.toHaveBeenCalled();
expect(result).toBe('a2');
@@ -151,7 +151,7 @@ describe('DelegateFactory', function() {
instance1.a.reset();
deregister();
var result = delegateInstance.a(2);
result = delegateInstance.a(2);
expect(instance1.a).not.toHaveBeenCalled();
expect(instance2.a).toHaveBeenCalledWith(2);
expect(instance3.a).not.toHaveBeenCalled();

View File

@@ -165,7 +165,7 @@ describe('Ionic Platform Service', function() {
ionic.Platform.setPlatform('iOS');
ionic.Platform.setVersion('7.0.3');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.platforms[0]).toEqual('webview');
expect(ionic.Platform.platforms[1]).toEqual('cordova');
@@ -179,7 +179,7 @@ describe('Ionic Platform Service', function() {
ionic.Platform.setPlatform('android');
ionic.Platform.setVersion('4.2.3');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.platforms[0]).toEqual('webview');
expect(ionic.Platform.platforms[1]).toEqual('cordova');
@@ -193,7 +193,7 @@ describe('Ionic Platform Service', function() {
ionic.Platform.setPlatform('');
ionic.Platform.setVersion('');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.platforms.length).toEqual(2);
expect(ionic.Platform.platforms[0]).toEqual('webview');
@@ -207,7 +207,7 @@ describe('Ionic Platform Service', function() {
ionic.Platform.setPlatform('');
ionic.Platform.setVersion('');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.platforms[0]).toEqual('browser');
});
@@ -216,7 +216,7 @@ describe('Ionic Platform Service', function() {
window.cordova = {};
ionic.Platform.setPlatform('iOS');
ionic.Platform.setVersion('7.1.1');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.grade).toEqual('a');
});
@@ -224,7 +224,7 @@ describe('Ionic Platform Service', function() {
window.cordova = {};
ionic.Platform.setPlatform('iOS');
ionic.Platform.setVersion('6.1.1');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.grade).toEqual('a');
});
@@ -232,7 +232,7 @@ describe('Ionic Platform Service', function() {
window.cordova = {};
ionic.Platform.setPlatform('android');
ionic.Platform.setVersion('4.4.1');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.grade).toEqual('a');
});
@@ -240,7 +240,7 @@ describe('Ionic Platform Service', function() {
window.cordova = {};
ionic.Platform.setPlatform('android');
ionic.Platform.setVersion('4.3.1');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.grade).toEqual('b');
});
@@ -248,7 +248,7 @@ describe('Ionic Platform Service', function() {
window.cordova = {};
ionic.Platform.setPlatform('android');
ionic.Platform.setVersion('4.0.0');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.grade).toEqual('b');
});
@@ -256,7 +256,7 @@ describe('Ionic Platform Service', function() {
window.cordova = {};
ionic.Platform.setPlatform('android');
ionic.Platform.setVersion('3.0.0');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.grade).toEqual('c');
});
@@ -264,7 +264,7 @@ describe('Ionic Platform Service', function() {
window.cordova = {};
ionic.Platform.setPlatform('android');
ionic.Platform.setVersion('2.3.4');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.grade).toEqual('c');
});
@@ -272,7 +272,7 @@ describe('Ionic Platform Service', function() {
window.cordova = {};
ionic.Platform.setPlatform('android');
ionic.Platform.setVersion('0');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.grade).toEqual('a');
});
@@ -280,7 +280,7 @@ describe('Ionic Platform Service', function() {
window.cordova = {};
ionic.Platform.setPlatform('whatever');
ionic.Platform.setVersion('20.3.4');
ionic.Platform._checkPlatforms()
ionic.Platform._checkPlatforms();
expect(ionic.Platform.grade).toEqual('a');
});

View File

@@ -67,7 +67,7 @@ describe('$ionicPopup service', function() {
});
it('should resolve with return value from button.onTap', function() {
popup.scope.$buttonTapped({
onTap: function() { return '123' }
onTap: function() { return '123'; }
}, {});
expect(popup.responseDeferred.resolve).toHaveBeenCalledWith('123');
});

View File

@@ -30,7 +30,7 @@ describe('Ionic View Service', function() {
.state('tabs.tab3view1', {})
.state('tabs.tab3view2', {})
.state('tabs.tab3view3', {})
.state('tabs.tab3view3', {});
}));
@@ -38,7 +38,7 @@ describe('Ionic View Service', function() {
viewService = $ionicViewService;
rootScope = $rootScope;
window = $window;
window.history.go = function(val) { return val };
window.history.go = function(val) { return val; };
}));
it('should do nothing if the same state happens', inject(function($state) {
@@ -375,7 +375,7 @@ describe('Ionic View Service', function() {
homeViewScope = {};
$state.go('home');
rootScope.$apply();
var homeReg = viewService.register(homeViewScope);
homeReg = viewService.register(homeViewScope);
expect(rootScope.$viewHistory.histories.root.cursor).toEqual(0);
expect(rootScope.$viewHistory.histories.root.stack.length).toEqual(1);
expect(homeReg.historyId).toEqual('root');
@@ -472,7 +472,7 @@ describe('Ionic View Service', function() {
expect(viewService.getCurrentStateName()).toEqual('tabs.tab1view2');
expect(viewService.getBackView().stateName).toEqual('tabs.tab1view1');
expect(viewService.getForwardView()).toEqual(null);
var lastView = viewService.getCurrentView();
lastView = viewService.getCurrentView();
expect(lastView.index).toEqual(1);
expect(tab1view2ScopeReg.viewId).toEqual(lastView.viewId);
expect(tab1view2ScopeReg.navAction).toEqual('newView');
@@ -487,7 +487,7 @@ describe('Ionic View Service', function() {
expect(viewService.getCurrentStateName()).toEqual('tabs.tab1view1');
expect(viewService.getBackView().stateName).toEqual('home');
expect(viewService.getForwardView().stateName).toEqual('tabs.tab1view2');
var lastView = viewService.getCurrentView();
lastView = viewService.getCurrentView();
expect(lastView.index).toEqual(0);
expect(tab1view1Scope2Reg.navAction).toEqual('moveBack');
expect(tab1view1Scope2Reg.navDirection).toEqual('back');
@@ -716,7 +716,7 @@ describe('Ionic View Service', function() {
var result = newView.go();
expect(result).toEqual(null);
$location.url('/nochange')
$location.url('/nochange');
newView = viewService.createView({ url: '/nochange' });
result = newView.go();
expect(result).toEqual(null);
@@ -746,13 +746,13 @@ describe('Ionic View Service', function() {
rootScope.$broadcast("viewState.changeHistory", { url: '/url' });
expect($location.url()).toEqual('/url');
rootScope.$viewHistory.histories['h123'] = { stack: [], cursor: -1 }
rootScope.$viewHistory.histories.h123 = { stack: [], cursor: -1 };
rootScope.$broadcast("viewState.changeHistory", { historyId: 'h123' });
expect($location.url()).toEqual('/url');
var newView = viewService.createView({ stateName: 'about' });
rootScope.$viewHistory.histories['h123'].stack.push(newView);
rootScope.$viewHistory.histories['h123'].cursor++;
rootScope.$viewHistory.histories.h123.stack.push(newView);
rootScope.$viewHistory.histories.h123.cursor++;
rootScope.$broadcast("viewState.changeHistory", { historyId: 'h123' });
rootScope.$apply();
expect($state.current.name).toEqual('about');