var editor;
return Backbone.Marionette.ItemView.extend({
onShow:function(){
editor=_.clone(ace);
.................
}
enable:function(){
edit.onPaste = editor.onPaste;
..............
}
}
I am new to js Now i want to write a test case for the function enable. here editor is declared as global and is intialized in onshow function. i am getting editor as undefined in the test for enable function, how to resolve this. please help me Thank you.
The test case is like
it('Case #1:Check the enablerule Action function',function(){
expect(complexView.enableruleAction(view)).to.equal(undefined);
});