-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I am creating a new controller in controller.js:
var newController=Alloy.createController('index').getView();
In test file (Controller_Spec.js) addded the following to mock getView
var dealerControllerMock = {
getView: function(){}
};
beforeEach(function() {
MockRequire = require('../../ti-unit/mockrequire');
MockRequire.addMock('getView', dealerControllerMock);
controllerUnderTest = require('../../app/controllers/index');
});
but it is not working. I am getting the following error while running the npm test:
TypeError: Cannot read property 'getView' of undefined
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels