Skip to content

Commit

Permalink
fix(TestRunner): Addresses issue that prevented node tests from corre…
Browse files Browse the repository at this point in the history
…ctly running
  • Loading branch information
georgejecook committed May 20, 2020
1 parent 3a34516 commit c6aec59
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 39 deletions.
41 changes: 41 additions & 0 deletions src/NodeMixin.bs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
namespace Rooibos
' /**
' * @memberof module:TestRunner
' * @name Rooibos_RunNodeTests
' * @function
' * @instance
' * @description interface hook for exeucting tests on nodes. This method is for internal use only. Only the Rooibos framework should invoke this method
' * @param {Dynamic} args - associated array, containing all the information required to execute the tests.
' * @returns {Object} test stats object, for merging into main test stats
' */
function RunNodeTests(args) as object
? " RUNNING NODE TESTS"
totalStatObj = RBS_STATS.CreateTotalStatistic()

Rooibos.TestRunner.RunItGroups(args.metaTestSuite, totalStatObj, args.testUtilsDecoratorMethodName, args.config, args.runtimeConfig, m)
return totalStatObj
end function

' /**
' * @memberof module:TestRunner
' * @name CreateTestNode
' * @function
' * @instance
' * @description interface hook for correctly creating nodes that get tested. This ensures they are in the correct scope.
' * This method must be defined in your tests scene xml.
' * @param {String} nodeType - name of node to create. The framework will pass this in as required
' * @returns {Object} the required node, or invalid if it could not be invoked.
' */
function CreateTestNode(nodeType) as object
node = createObject("roSGNode", nodeType)

if (type(node) = "roSGNode" and node.subType() = nodeType)
m.top.AppendChild(node)
return node
else
? " Error creating test node of type " ; nodeType
return invalid
end if
end function

end namespace
39 changes: 0 additions & 39 deletions src/TestRunner.bs
Original file line number Diff line number Diff line change
Expand Up @@ -343,43 +343,4 @@ public sub SendHomeKeypress()
ut.PostFromString("")
end sub

' /**
' * @memberof module:TestRunner
' * @name Rooibos_RunNodeTests
' * @function
' * @instance
' * @description interface hook for exeucting tests on nodes. This method is for internal use only. Only the Rooibos framework should invoke this method
' * @param {Dynamic} args - associated array, containing all the information required to execute the tests.
' * @returns {Object} test stats object, for merging into main test stats
' */
function RunNodeTests(args) as object
? " RUNNING NODE TESTS"
totalStatObj = RBS_STATS.CreateTotalStatistic()

m.RunItGroups(args.metaTestSuite, totalStatObj, args.testUtilsDecoratorMethodName, args.config, args.runtimeConfig, m)
return totalStatObj
end function

' /**
' * @memberof module:TestRunner
' * @name CreateTestNode
' * @function
' * @instance
' * @description interface hook for correctly creating nodes that get tested. This ensures they are in the correct scope.
' * This method must be defined in your tests scene xml.
' * @param {String} nodeType - name of node to create. The framework will pass this in as required
' * @returns {Object} the required node, or invalid if it could not be invoked.
' */
function CreateTestNode(nodeType) as object
node = createObject("roSGNode", nodeType)

if (type(node) = "roSGNode" and node.subType() = nodeType)
m.top.AppendChild(node)
return node
else
? " Error creating test node of type " ; nodeType
return invalid
end if
end function

end namespace

0 comments on commit c6aec59

Please sign in to comment.