-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tslint-ionic-rules and lint project according to ionic's standard
- Loading branch information
1 parent
6c435c6
commit b638634
Showing
39 changed files
with
569 additions
and
564 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { ActionSheetMock } from './action-sheet'; | ||
import {ActionSheetMock} from './action-sheet'; | ||
|
||
export class ActionSheetControllerMock { | ||
public static instance(actionSheet?: ActionSheetMock): any { | ||
public static instance(actionSheet?: ActionSheetMock): any { | ||
|
||
let instance = jasmine.createSpyObj('ActionSheetController', ['create']); | ||
instance.create.and.returnValue(actionSheet || ActionSheetMock.instance()); | ||
let instance = jasmine.createSpyObj('ActionSheetController', ['create']); | ||
instance.create.and.returnValue(actionSheet || ActionSheetMock.instance()); | ||
|
||
return instance; | ||
} | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { ActionSheetMock } from './action-sheet'; | ||
import {ActionSheetMock} from './action-sheet'; | ||
describe('ActionSheetMock', () => { | ||
it('should initialize', () => { | ||
expect(ActionSheetMock.instance).toBeDefined() | ||
}); | ||
}); | ||
it('should initialize', () => { | ||
expect(ActionSheetMock.instance).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export class ActionSheetMock { | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('ActionSheet', ['present', 'dismiss']); | ||
instance.present.and.returnValue(Promise.resolve()); | ||
instance.dismiss.and.returnValue(Promise.resolve()); | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('ActionSheet', ['present', 'dismiss']); | ||
instance.present.and.returnValue(Promise.resolve()); | ||
instance.dismiss.and.returnValue(Promise.resolve()); | ||
|
||
return instance; | ||
} | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { AlertMock } from './alert'; | ||
import {AlertMock} from './alert'; | ||
|
||
export class AlertControllerMock { | ||
public static instance(alertMock?: AlertMock): any { | ||
public static instance(alertMock?: AlertMock): any { | ||
|
||
let instance = jasmine.createSpyObj('AlertController', ['create']); | ||
instance.create.and.returnValue(alertMock || AlertMock.instance()); | ||
let instance = jasmine.createSpyObj('AlertController', ['create']); | ||
instance.create.and.returnValue(alertMock || AlertMock.instance()); | ||
|
||
return instance; | ||
} | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export class AlertMock { | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('Alert', ['present', 'dismiss']); | ||
instance.present.and.returnValue(Promise.resolve()); | ||
instance.dismiss.and.returnValue(Promise.resolve()); | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('Alert', ['present', 'dismiss']); | ||
instance.present.and.returnValue(Promise.resolve()); | ||
instance.dismiss.and.returnValue(Promise.resolve()); | ||
|
||
return instance; | ||
} | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import { Observable } from 'rxjs'; | ||
import { NavControllerMock } from "./nav-controller"; | ||
import {Observable} from 'rxjs'; | ||
import {NavControllerMock} from './nav-controller'; | ||
|
||
export class AppMock { | ||
public static instance(navCtrl?: NavControllerMock, viewObservable?: Observable<any>): any { | ||
public static instance(navCtrl?: NavControllerMock, viewObservable?: Observable<any>): any { | ||
|
||
let instance = jasmine.createSpyObj('App', [ | ||
'getActiveNav', | ||
'getRootNav', | ||
'isScrolling', | ||
'setTitle', | ||
'viewDidEnter', | ||
'viewDidLeave', | ||
'viewDidLoad', | ||
'viewWillEnter', | ||
'viewWillLeave', | ||
'viewWillUnload' | ||
]); | ||
let instance = jasmine.createSpyObj('App', [ | ||
'getActiveNav', | ||
'getRootNav', | ||
'isScrolling', | ||
'setTitle', | ||
'viewDidEnter', | ||
'viewDidLeave', | ||
'viewDidLoad', | ||
'viewWillEnter', | ||
'viewWillLeave', | ||
'viewWillUnload' | ||
]); | ||
|
||
instance.getRootNav.and.returnValue(navCtrl || NavControllerMock.instance()); | ||
instance.isScrolling.and.returnValue(false); | ||
instance.viewDidEnter.and.returnValue(viewObservable || Observable.of(undefined)); | ||
instance.viewDidLoad.and.returnValue(viewObservable || Observable.of(undefined)); | ||
instance.viewDidLeave.and.returnValue(viewObservable || Observable.of(undefined)); | ||
instance.viewWillEnter.and.returnValue(viewObservable || Observable.of(undefined)); | ||
instance.viewWillUnload.and.returnValue(viewObservable || Observable.of(undefined)); | ||
instance.viewWillLeave.and.returnValue(viewObservable || Observable.of(undefined)); | ||
instance.getRootNav.and.returnValue(navCtrl || NavControllerMock.instance()); | ||
instance.isScrolling.and.returnValue(false); | ||
instance.viewDidEnter.and.returnValue(viewObservable || Observable.of(undefined)); | ||
instance.viewDidLoad.and.returnValue(viewObservable || Observable.of(undefined)); | ||
instance.viewDidLeave.and.returnValue(viewObservable || Observable.of(undefined)); | ||
instance.viewWillEnter.and.returnValue(viewObservable || Observable.of(undefined)); | ||
instance.viewWillUnload.and.returnValue(viewObservable || Observable.of(undefined)); | ||
instance.viewWillLeave.and.returnValue(viewObservable || Observable.of(undefined)); | ||
|
||
return instance; | ||
} | ||
} | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
export class ConfigMock { | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('Config', [ | ||
'get', | ||
'getBoolean', | ||
'getNumber', | ||
'set', | ||
'settings', | ||
'setModeConfig', | ||
'getModeConfig', | ||
'setTransition', | ||
'getTransition' | ||
]); | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('Config', [ | ||
'get', | ||
'getBoolean', | ||
'getNumber', | ||
'set', | ||
'settings', | ||
'setModeConfig', | ||
'getModeConfig', | ||
'setTransition', | ||
'getTransition' | ||
]); | ||
|
||
instance.get.and.returnValue(''); | ||
instance.getBoolean.and.returnValue(true); | ||
instance.getNumber.and.returnValue(0); | ||
instance.get.and.returnValue(''); | ||
instance.getBoolean.and.returnValue(true); | ||
instance.getNumber.and.returnValue(0); | ||
|
||
return instance; | ||
} | ||
} | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
export class ContentMock { | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('Content', ['addImg', 'getContentDimensions', 'getFixedElement', 'resize', 'scrollTo', 'scrollToBottom', 'scrollToTop']); | ||
instance['contentBottom'] = 10; | ||
instance['contentHeight'] = 10; | ||
instance['contentTop'] = 10; | ||
instance['directionX'] = 'left'; | ||
instance['directionY'] = 'up'; | ||
instance['isScrolling'] = false; | ||
instance['scrollHeight'] = 10; | ||
instance['scrollLeft'] = 10; | ||
instance['scrollTop'] = 10; | ||
instance['scrollWidth'] = 10; | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('Content', ['addImg', 'getContentDimensions', 'getFixedElement', 'resize', 'scrollTo', 'scrollToBottom', 'scrollToTop']); | ||
instance['contentBottom'] = 10; | ||
instance['contentHeight'] = 10; | ||
instance['contentTop'] = 10; | ||
instance['directionX'] = 'left'; | ||
instance['directionY'] = 'up'; | ||
instance['isScrolling'] = false; | ||
instance['scrollHeight'] = 10; | ||
instance['scrollLeft'] = 10; | ||
instance['scrollTop'] = 10; | ||
instance['scrollWidth'] = 10; | ||
|
||
let dimensions = {}; | ||
instance.getContentDimensions.and.returnValue(dimensions); | ||
instance.scrollTo.and.returnValue(Promise.resolve()); | ||
instance.scrollToBottom.and.returnValue(Promise.resolve()); | ||
instance.scrollToTop.and.returnValue(Promise.resolve()); | ||
let dimensions = {}; | ||
instance.getContentDimensions.and.returnValue(dimensions); | ||
instance.scrollTo.and.returnValue(Promise.resolve()); | ||
instance.scrollToBottom.and.returnValue(Promise.resolve()); | ||
instance.scrollToTop.and.returnValue(Promise.resolve()); | ||
|
||
|
||
return instance; | ||
} | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export class EventsMock { | ||
public static instance(): any { | ||
return jasmine.createSpyObj('events', ['subscribe', 'publish', 'unsubscribe']); | ||
} | ||
} | ||
public static instance(): any { | ||
return jasmine.createSpyObj('events', ['subscribe', 'publish', 'unsubscribe']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
export class FormMock { | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('Form', [ | ||
'register', | ||
'nextId', | ||
'deregister', | ||
'setAsFocused', | ||
'unsetAsFocused', | ||
'tabFocus' | ||
]); | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('Form', [ | ||
'register', | ||
'nextId', | ||
'deregister', | ||
'setAsFocused', | ||
'unsetAsFocused', | ||
'tabFocus' | ||
]); | ||
|
||
instance.nextId.and.returnValue(0); | ||
instance.nextId.and.returnValue(0); | ||
|
||
return instance; | ||
} | ||
} | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
export class HapticMock { | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('Haptic', ['available', | ||
'gestureSelectionChanged', | ||
'gestureSelectionEnd', | ||
'gestureSelectionStart', | ||
'impact', | ||
'notification', | ||
'selection' | ||
]); | ||
instance.available.and.returnValue(true); | ||
public static instance(): any { | ||
let instance = jasmine.createSpyObj('Haptic', ['available', | ||
'gestureSelectionChanged', | ||
'gestureSelectionEnd', | ||
'gestureSelectionStart', | ||
'impact', | ||
'notification', | ||
'selection' | ||
]); | ||
instance.available.and.returnValue(true); | ||
|
||
return instance; | ||
} | ||
return instance; | ||
} | ||
} |
Oops, something went wrong.