How to write unit test in Jasmine to nested function

117 views Asked by At

My JS file:

outer.fucntionMethod = funtion () {

inner.functionMethod = (function (intput) {
    var temp = intput.spilt("inner").join("funtionMethod");
    return temp;
    });
}

I need to write unit test this method: "inner.functionMethod()"

1

There are 1 answers

0
alanka_kishore On

I found my solution on my own...

var outermethod = new outer.fucntionMethod();

outermethod.inner = inner;

outermethod.inner.functionMethod();

If i code it.. i can access the "inner.functionMethod()" to test it.