crypto icon indicating copy to clipboard operation
crypto copied to clipboard

Environment for mocked component is wrong

Open lkipke opened this issue 5 years ago • 1 comments

Example:

In testcase.test.brs:

_brs_.mockComponent("DependencyComponent", {
    helloWorld: function()
        return m.top.subtype()
    end function
})

In MyComponent.brs:

dep = createObject("roSGNode", "dependencyComponent")
print dep.helloWorld() ' => "MyComponent"

It seems like the environment isn't getting seeded correctly for a member method.

lkipke avatar Nov 05 '20 23:11 lkipke

just want to add a note that brs has the same behavior if use dep.callFunc("helloWorld").

Vasya-M avatar Nov 10 '20 09:11 Vasya-M