-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
I'm trying to test a custom component, using the following code:
components/MyComponent.xml:
<component name="MyComponent" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd">
<script type="text/brightscript" uri="pkg:/components/MyComponent.brs" />
</component>components/MyComponent.brs:
function init()
print "init() called"
end functiontests/MyComponent.test.brs:
function main(args as object) as object
return roca(args).describe("A sample test suite", sub()
m.it("has a task", sub()
test = CreateObject("roSGNode", "MyComponent")
m.assert.isValid(test, "Should be valid")
end sub)
end sub)
end functionRunning the test always fails with the following output:
m.assert.isValid: Should be valid
+ expected - actual
-null
+non-invalid
at m.assert.isValid (src/tests/MyComponent.test.brs:5:12)
Whenever I try creating another type of object, for instance CreateObject("roDeviceInfo"), then the test succeeds.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels