Hi All,
I am trying to implement QUnit testing for my UI5 app. As mentioned in some articles I have created my test.js file to write all the test cases, one qunit.html file for bootstrapping libraries including test.js and mycontroller.js files. All my functionalities are in mycontroller.js which I want to test.
Now my issue is, when I am trying to test the methods which are directly written inside other JS files, I am able to do that but when I am trying to test methods of controller file, its shows me method is undefined.
I suspect the reason is my controller has following structure.And when I am trying to access the method using "MyController.myMethod" the test.js file is not able to catch the method.
MyController.js
sap.ui.controller("MyController", {
myMethod: function(){}
}
test.js
QUnit.test( "Sample test", function( ) {
ok(MyController.myMethod, "Employee type Test Passed!" );
});
Can you please suggest a way how we can access methods of controller file?
Regards,
Anupriya