Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"roSGNode.ObserveField: no active host node" when trying to use a timer #188

Open
ZeeD opened this issue Sep 12, 2022 · 1 comment
Open

Comments

@ZeeD
Copy link
Contributor

ZeeD commented Sep 12, 2022

If there is a timer in one of the tests, it fails to run.

minimal scenario:

sub myCb(e)
    print e
end sub

function myFunc()
    timer = createObject("roSGNode", "Timer")
    timer.observeField("fire", "myCb")
    timer.duration = 0.01
    timer.repeat = false
    timer.control = "start"
    return timer
end function

namespace tests
    @suite()
    class MyTests extends rooibos.BaseTestSuite
        @describe("myTest")
        @it("should")
        function _()
            ret = myFunc()
        end function
    end class
end namespace

all I got is

[2022-09-12T16:30:45.091Z] BRIGHTSCRIPT: ERROR: roSGNode.ObserveField: no active host node: pkg:/source/myTest.spec.brs(7)
@georgejecook
Copy link
Collaborator

georgejecook commented Nov 1, 2022

Sg render thread does not execute in rooibos unit tests, so observe and other calls cannot work. You need to make a node test for this.

Even then, I'm not sure it will run async tests like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants