Skip to content

Conversation

@tgadre
Copy link

@tgadre tgadre commented Feb 5, 2018

I am taking over the work for the following pull request. This PR is same as #31. @stonelasley Did you get a chance to test it out?

Thanks

@danielsogl
Copy link

You can find the jest version here: https://www.npmjs.com/package/ionic-mocks-jest

};
return ActionSheetControllerMock;
}());
exports.ActionSheetControllerMock = ActionSheetControllerMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var create_spy_1 = require("../utilities/create-spy");
var action_sheet_1 = require("./action-sheet");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var create_spy_1 = require("../utilities/create-spy");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,16 @@
"use strict";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

var action_sheet_1 = require("./action-sheet");
describe('ActionSheetMock', function () {
it('should initialize', function () {
expect(action_sheet_1.ActionSheetMock.instance).toBeDefined();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'expect' is not defined.

Object.defineProperty(exports, "__esModule", { value: true });
var action_sheet_1 = require("./action-sheet");
describe('ActionSheetMock', function () {
it('should initialize', function () {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'it' is not defined.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var action_sheet_1 = require("./action-sheet");
describe('ActionSheetMock', function () {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'describe' is not defined.

@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var action_sheet_1 = require("./action-sheet");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

ActionSheetMock.instance = function () {
var instance = create_spy_1.createSpyObj('ActionSheet', ['present', 'dismiss']);
instance.present.and.returnValue(Promise.resolve());
instance.dismiss.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

}
ActionSheetMock.instance = function () {
var instance = create_spy_1.createSpyObj('ActionSheet', ['present', 'dismiss']);
instance.present.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var create_spy_1 = require("../utilities/create-spy");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,16 @@
"use strict";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

};
return AlertControllerMock;
}());
exports.AlertControllerMock = AlertControllerMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var create_spy_1 = require("../utilities/create-spy");
var alert_1 = require("./alert");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var create_spy_1 = require("../utilities/create-spy");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,16 @@
"use strict";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

};
return ActionSheetMock;
}());
exports.ActionSheetMock = ActionSheetMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

ActionSheetMock.instance = function () {
var instance = create_spy_1.createSpyObj('ActionSheet', ['present', 'dismiss']);
instance.present.and.returnValue(Promise.resolve());
instance.dismiss.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

}
ActionSheetMock.instance = function () {
var instance = create_spy_1.createSpyObj('ActionSheet', ['present', 'dismiss']);
instance.present.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var create_spy_1 = require("../utilities/create-spy");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

}
return obj;
}
exports.createSpyObj = createSpyObj;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

function createSpyObj(baseName, methodNames) {
var obj = {};
for (var i = 0; i < methodNames.length; i++) {
obj[methodNames[i]] = jasmine.createSpy(baseName, function () { });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'jasmine' is not defined.

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,11 @@
"use strict";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

describe('vibrate', function () {
it('should have been called', function () {
vibration.vibrate();
expect(vibration.vibrate).toHaveBeenCalled();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'expect' is not defined.

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var vibration_1 = require("./vibration");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,19 @@
"use strict";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

};
return VibrationMock;
}());
exports.VibrationMock = VibrationMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

function VibrationMock() {
}
VibrationMock.instance = function () {
var instance = jasmine.createSpyObj('Vibration', ['vibrate']);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'jasmine' is not defined.

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,14 @@
"use strict";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

};
return ThreeDeeTouchMock;
}());
exports.ThreeDeeTouchMock = ThreeDeeTouchMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

'enableLinkPreview',
'disableLinkPreview'
]);
instance.isAvailable.and.returnValue(Promise.resolve(true));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("rxjs/Observable");
var create_spy_1 = require("../utilities/create-spy");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,25 @@
"use strict";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

};
return SplashScreenMock;
}());
exports.SplashScreenMock = SplashScreenMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var create_spy_1 = require("../utilities/create-spy");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,13 @@
"use strict";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

};
return NFCMock;
}());
exports.NFCMock = NFCMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("rxjs/Observable");
var create_spy_1 = require("../utilities/create-spy");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("rxjs/Observable");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

};
return KeyboardMock;
}());
exports.KeyboardMock = KeyboardMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("rxjs/Observable");
var create_spy_1 = require("../utilities/create-spy");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("rxjs/Observable");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,24 @@
"use strict";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

var nfc_1 = require("./nfc");
exports.NFCMock = nfc_1.NFCMock;
var vibration_1 = require("./vibration");
exports.VibrationMock = vibration_1.VibrationMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

exports.GoogleAnalyticsMock = google_analytics_1.GoogleAnalyticsMock;
var nfc_1 = require("./nfc");
exports.NFCMock = nfc_1.NFCMock;
var vibration_1 = require("./vibration");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

var google_analytics_1 = require("./google-analytics");
exports.GoogleAnalyticsMock = google_analytics_1.GoogleAnalyticsMock;
var nfc_1 = require("./nfc");
exports.NFCMock = nfc_1.NFCMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

exports.NetworkMock = network_1.NetworkMock;
var google_analytics_1 = require("./google-analytics");
exports.GoogleAnalyticsMock = google_analytics_1.GoogleAnalyticsMock;
var nfc_1 = require("./nfc");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

var network_1 = require("./network");
exports.NetworkMock = network_1.NetworkMock;
var google_analytics_1 = require("./google-analytics");
exports.GoogleAnalyticsMock = google_analytics_1.GoogleAnalyticsMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

exports.SplashScreenMock = splash_screen_1.SplashScreenMock;
var keyboard_1 = require("./keyboard");
exports.KeyboardMock = keyboard_1.KeyboardMock;
var status_bar_1 = require("./status-bar");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

var splash_screen_1 = require("./splash-screen");
exports.SplashScreenMock = splash_screen_1.SplashScreenMock;
var keyboard_1 = require("./keyboard");
exports.KeyboardMock = keyboard_1.KeyboardMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

Object.defineProperty(exports, "__esModule", { value: true });
var splash_screen_1 = require("./splash-screen");
exports.SplashScreenMock = splash_screen_1.SplashScreenMock;
var keyboard_1 = require("./keyboard");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var splash_screen_1 = require("./splash-screen");
exports.SplashScreenMock = splash_screen_1.SplashScreenMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var splash_screen_1 = require("./splash-screen");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

@@ -0,0 +1,19 @@
"use strict";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

};
return GoogleAnalyticsMock;
}());
exports.GoogleAnalyticsMock = GoogleAnalyticsMock;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

instance.trackTiming.and.returnValue(Promise.resolve());
instance.addTransaction.and.returnValue(Promise.resolve());
instance.addTransactionItem.and.returnValue(Promise.resolve());
instance.enableUncaughtExceptionReporting.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

instance.trackException.and.returnValue(Promise.resolve());
instance.trackTiming.and.returnValue(Promise.resolve());
instance.addTransaction.and.returnValue(Promise.resolve());
instance.addTransactionItem.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

instance.setAppVersion.and.returnValue(Promise.resolve());
instance.setOptOut.and.returnValue(Promise.resolve());
instance.debugMode.and.returnValue(Promise.resolve());
instance.trackMetric.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

instance.setAnonymizeIp.and.returnValue(Promise.resolve());
instance.setAppVersion.and.returnValue(Promise.resolve());
instance.setOptOut.and.returnValue(Promise.resolve());
instance.debugMode.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

instance.setUserId.and.returnValue(Promise.resolve());
instance.setAnonymizeIp.and.returnValue(Promise.resolve());
instance.setAppVersion.and.returnValue(Promise.resolve());
instance.setOptOut.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

instance.setAllowIDFACollection.and.returnValue(Promise.resolve());
instance.setUserId.and.returnValue(Promise.resolve());
instance.setAnonymizeIp.and.returnValue(Promise.resolve());
instance.setAppVersion.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

instance.startTrackerWithId.and.returnValue(Promise.resolve());
instance.setAllowIDFACollection.and.returnValue(Promise.resolve());
instance.setUserId.and.returnValue(Promise.resolve());
instance.setAnonymizeIp.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

]);
instance.startTrackerWithId.and.returnValue(Promise.resolve());
instance.setAllowIDFACollection.and.returnValue(Promise.resolve());
instance.setUserId.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

'enableUncaughtExceptionReporting'
]);
instance.startTrackerWithId.and.returnValue(Promise.resolve());
instance.setAllowIDFACollection.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

'addTransactionItem',
'enableUncaughtExceptionReporting'
]);
instance.startTrackerWithId.and.returnValue(Promise.resolve());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Promise' is not defined.

@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var create_spy_1 = require("../utilities/create-spy");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is not defined.

it('should return spyable Promise that resolves to default key', function (done) {
classUnderTest.keys()
.then(function (res) {
expect(classUnderTest.keys).toHaveBeenCalled();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'expect' is not defined.

});
});
describe('keys', function () {
it('should return spyable Promise that resolves to default key', function (done) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'it' is not defined.

});
});
});
describe('keys', function () {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'describe' is not defined.

classUnderTest.length()
.then(function (res) {
expect(classUnderTest.length).toHaveBeenCalled();
expect(res).toEqual(1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'expect' is not defined.

it('should return spyable Promise that resolves to 1', function (done) {
classUnderTest.length()
.then(function (res) {
expect(classUnderTest.length).toHaveBeenCalled();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'expect' is not defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants