-1

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()"

  • How is `inner` defined? Do you have access to both `inner` and `outer` in your test? If you do, then you just execute `outer.functionMethod()`, then `inner.functionMethod` will be defined, and you can test it like any other function. – Seth Flowers Dec 04 '18 at 15:11

1 Answers1

0

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.