diff --git a/src/NodeMixin.bs b/src/NodeMixin.bs new file mode 100644 index 00000000..78facaa3 --- /dev/null +++ b/src/NodeMixin.bs @@ -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 \ No newline at end of file diff --git a/src/TestRunner.bs b/src/TestRunner.bs index 4bb5b3fc..3b32d905 100644 --- a/src/TestRunner.bs +++ b/src/TestRunner.bs @@ -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 \ No newline at end of file