Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
365 changes: 227 additions & 138 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@
"karma-chrome-launcher": "^2.1.1",
"karma-coveralls": "^1.2.1",
"karma-jasmine": "^1.1.2",
"karma-typescript": "^3.0.3",
"karma-typescript": "^3.0.13",
"rimraf": "^2.6.1",
"rxjs": "^5.4.2",
"rxjs": "^6.3.3",
"rxjs-compat": "^6.3.3",
"semantic-release": "^15.6.3",
"tslint": "^5.5.0",
"tslint-ionic-rules": "0.0.11",
Expand Down
14 changes: 7 additions & 7 deletions src/angular/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from 'rxjs/Observable';
import { Observable, of } from 'rxjs';
import { ArrayObservable } from 'rxjs/observable/ArrayObservable';
import { NavControllerMock } from './nav-controller';
import { BaseMock } from '../base.mock';
Expand Down Expand Up @@ -48,22 +48,22 @@ export class AppMock extends BaseMock {
);
this.spyObj.isScrolling.and.returnValue(false);
this.spyObj.viewDidEnter.and.returnValue(
_viewObservable || ArrayObservable.of(undefined)
_viewObservable || of(undefined)
);
this.spyObj.viewDidLoad.and.returnValue(
_viewObservable || ArrayObservable.of(undefined)
_viewObservable || of(undefined)
);
this.spyObj.viewDidLeave.and.returnValue(
_viewObservable || ArrayObservable.of(undefined)
_viewObservable || of(undefined)
);
this.spyObj.viewWillEnter.and.returnValue(
_viewObservable || ArrayObservable.of(undefined)
_viewObservable || of(undefined)
);
this.spyObj.viewWillLeave.and.returnValue(
_viewObservable || ArrayObservable.of(undefined)
_viewObservable || of(undefined)
);
this.spyObj.viewWillUnload.and.returnValue(
_viewObservable || ArrayObservable.of(undefined)
_viewObservable || of(undefined)
);
}

Expand Down
14 changes: 7 additions & 7 deletions src/angular/nav-controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from 'rxjs/Observable';
import { Observable, of } from 'rxjs';
import { ViewControllerMock } from './view-controller';
import { BaseMock } from '../base.mock';
import deprecated from 'deprecated-decorator';
Expand Down Expand Up @@ -81,12 +81,12 @@ export class NavControllerMock extends BaseMock {
this.spyObj.indexOf.and.returnValue(0);
this.spyObj.getViews.and.returnValue([]);
this.spyObj.isSwipeBackEnabled.and.returnValue(true);
this.spyObj.viewDidEnter = Observable.of();
this.spyObj.viewDidLeave = Observable.of();
this.spyObj.viewDidLoad = Observable.of();
this.spyObj.viewWillEnter = Observable.of();
this.spyObj.viewWillLeave = Observable.of();
this.spyObj.viewWillUnload = Observable.of();
this.spyObj.viewDidEnter = of();
this.spyObj.viewDidLeave = of();
this.spyObj.viewDidLoad = of();
this.spyObj.viewWillEnter = of();
this.spyObj.viewWillLeave = of();
this.spyObj.viewWillUnload = of();
this.spyObj['length'].and.returnValue(0);
this.spyObj['root'] = new ViewControllerMock();
this.spyObj['rootParams'] = {};
Expand Down
16 changes: 8 additions & 8 deletions src/angular/view-controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from 'rxjs';
import { Observable, of } from 'rxjs';
import { NavParamsMock } from './nav-params';
import { BaseMock } from '../base.mock';
import deprecated from 'deprecated-decorator';
Expand Down Expand Up @@ -43,12 +43,12 @@ export class ViewControllerMock extends BaseMock {
constructor() {
super('ViewController', METHODS);

this.spyObj.willEnter.and.returnValue(Observable.of({}));
this.spyObj.didEnter.and.returnValue(Observable.of({}));
this.spyObj.willLeave.and.returnValue(Observable.of({}));
this.spyObj.didLeave.and.returnValue(Observable.of({}));
this.spyObj.willUnload.and.returnValue(Observable.of({}));
this.spyObj.didUnload.and.returnValue(Observable.of({}));
this.spyObj.willEnter.and.returnValue(of({}));
this.spyObj.didEnter.and.returnValue(of({}));
this.spyObj.willLeave.and.returnValue(of({}));
this.spyObj.didLeave.and.returnValue(of({}));
this.spyObj.willUnload.and.returnValue(of({}));
this.spyObj.didUnload.and.returnValue(of({}));
this.spyObj.dismiss.and.returnValue(Promise.resolve());
this.spyObj.onDidDismiss.and.returnValue(Promise.resolve());
this.spyObj.onWillDismiss.and.returnValue(Promise.resolve());
Expand All @@ -60,7 +60,7 @@ export class ViewControllerMock extends BaseMock {
this.spyObj.contentRef.and.returnValue(Promise.resolve());
this.spyObj.hasNavbar.and.returnValue(true);
this.spyObj.index.and.returnValue(true);
this.spyObj.subscribe.and.returnValue(Observable.of({}));
this.spyObj.subscribe.and.returnValue(of({}));
this.spyObj.getNav.and.returnValue({});
this.spyObj.getIONContent.and.returnValue({});

Expand Down
6 changes: 3 additions & 3 deletions src/native/keyboard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from 'rxjs/Observable';
import { Observable, of } from 'rxjs';

export class KeyboardMock {
public static instance(): any {
Expand All @@ -11,8 +11,8 @@ export class KeyboardMock {
'onKeyboardHide'
]);

instance.onKeyboardShow.and.returnValue(Observable.empty());
instance.onKeyboardHide.and.returnValue(Observable.empty());
instance.onKeyboardShow.and.returnValue(of(null));
instance.onKeyboardHide.and.returnValue(of(null));

return instance;
}
Expand Down
8 changes: 4 additions & 4 deletions src/native/network.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from 'rxjs/Observable';
import { Observable, of } from 'rxjs';

export class NetworkMock {
public static instance(networkType: string): any {
Expand All @@ -11,9 +11,9 @@ export class NetworkMock {
]);
instance.type.and.returnValue(networkType || 'wifi');
instance.downlinkMax.and.returnValue('42');
instance.onChange.and.returnValue(Observable.empty());
instance.onDisconnect.and.returnValue(Observable.empty());
instance.onConnect.and.returnValue(Observable.empty());
instance.onChange.and.returnValue(of(null));
instance.onDisconnect.and.returnValue(of(null));
instance.onConnect.and.returnValue(of(null));
return instance;
}
}
28 changes: 14 additions & 14 deletions src/native/nfc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from 'rxjs/Observable';
import { Observable, of } from 'rxjs';

export class NFCMock {
public static instance(): any {
Expand All @@ -20,19 +20,19 @@ export class NFCMock {
'stringToBytes',
'bytesToHexString'
]);
instance.addNdefListener.and.returnValue(Observable.empty());
instance.addTagDiscoveredListener.and.returnValue(Observable.empty());
instance.addMimeTypeListener.and.returnValue(Observable.empty());
instance.addNdefFormatableListener.and.returnValue(Observable.empty());
instance.write.and.returnValue(Observable.empty());
instance.makeReadyOnly.and.returnValue(Observable.empty());
instance.share.and.returnValue(Observable.empty());
instance.unshare.and.returnValue(Observable.empty());
instance.erase.and.returnValue(Observable.empty());
instance.handover.and.returnValue(Observable.empty());
instance.stopHandover.and.returnValue(Observable.empty());
instance.showSettings.and.returnValue(Observable.empty());
instance.enabled.and.returnValue(Observable.empty());
instance.addNdefListener.and.returnValue(of(null));
instance.addTagDiscoveredListener.and.returnValue(of(null));
instance.addMimeTypeListener.and.returnValue(of(null));
instance.addNdefFormatableListener.and.returnValue(of(null));
instance.write.and.returnValue(of(null));
instance.makeReadyOnly.and.returnValue(of(null));
instance.share.and.returnValue(of(null));
instance.unshare.and.returnValue(of(null));
instance.erase.and.returnValue(of(null));
instance.handover.and.returnValue(of(null));
instance.stopHandover.and.returnValue(of(null));
instance.showSettings.and.returnValue(of(null));
instance.enabled.and.returnValue(of(null));
instance.bytesToString.and.returnValue('');
instance.stringToBytes.and.returnValue([]);
instance.bytesToHexString.and.returnValue('');
Expand Down
6 changes: 3 additions & 3 deletions src/native/three-dee-touch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from 'rxjs/Observable';
import { Observable, of } from 'rxjs';

export class ThreeDeeTouchMock {
public static instance(): any {
Expand All @@ -11,8 +11,8 @@ export class ThreeDeeTouchMock {
'disableLinkPreview'
]);
instance.isAvailable.and.returnValue(Promise.resolve(true));
instance.watchForTouches.and.returnValue(Observable.of({}));
instance.onHomeIconPressed.and.returnValue(Observable.empty());
instance.watchForTouches.and.returnValue(of({}));
instance.onHomeIconPressed.and.returnValue(of(null));

return instance;
}
Expand Down