sjbarag / brs

An interpreter for the BrightScript language that runs on non-Roku platforms.
MIT License
113 stars 43 forks source link

mockComponent fails silently if node is passed instead of RoAssocArray #651

Open underwoo16 opened 3 years ago

underwoo16 commented 3 years ago

_brs_.mockComponent is meant to receive an assocarray:

_brs_.mockComponent("MyComponent", {})

but if you accidentally pass in a node because you forgot: _brs_.mockComponent("MyComponent", createObject("roSGNode", "Node"))

it fails silently and when code is executed to create MyComponent: createObject("roSGNode", "MyComponent")

the real implementation of the component is returned instead of a mock, with no logs or anything indicating the mock did not work