You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This describes custom reporter support in rooibos.
Deprecate reporter in favor of reporters. Internally copy reporter value into reporters so it's backwards compatible. reporters will be an array of reporter factory functions (or class name).
The rooibos runtime will now support multiple reporters. Each string name in the reporters list will be the name of a function that is a reporter factory (which also will support class names too since those are technically factories anyway). These reporters are created ONCE, at the start of the entire test run. These reporters much confirm to the following structure: Each method is optional.
onBegin - called at the very start of the testing process.
beforeSuite - called before the first test in each @suite
beforeDescribe - called before the first test in each @describe block
beforeIt - called before each @it() test. If the test is parameterized, will be called once for each parameterized combo. To help better reporting with parameterized tests, will include some form of isParameterized and index so you can report a header at the start of a parameterized @it group.
afterIt - called after each @it. Same rules as beforeIt
afterDescribe - called after the final test in this @describe block finishes
afterSuite - called after the final test in this @suite finishes
onEnd - called when the entire testing process is finished
Here's an example reporter factory:
```brighterscript
function happyReporter()
return {
onBegin: function(event)
print "About to run your first rooibos test!"
end function
beforeSuite: function(event)
print "before run suite " event.suite.name
end function
beforeDescribe: function(event)
print "before run describe " event.describe.name
end function
beforeIt: function(event)
print "before run it " event.it.name
end function
afterIt: function(event)
print "after run it " event.it.name
end function
afterDescribe: function(event)
print "after run describe " event.describe.name
end function
afterSuite: function(event)
print "before run suite " event.suite.name
end function
onEnd: function(event)
print "Yay, tests are done"
end function
}
end function
The internals of rooibos will need to revise how reporting is done. We haven't flushed out the specific interfaces for the callback event structures.
The text was updated successfully, but these errors were encountered:
Just so it isn't forgotten, these reporters will need to be supported in node tests as well.
Unless you're thinking of revamping how node tests report their results (as I think they're self-reporting right now), the easiest way I can think of is to have an option to add custom .bs imports for the rooibos-generated nodes.
This describes custom reporter support in rooibos.
reporter
in favor ofreporters
. Internally copyreporter
value intoreporters
so it's backwards compatible.reporters
will be an array of reporter factory functions (or class name).bsconfig.json
reporters
list will be the name of a function that is a reporter factory (which also will support class names too since those are technically factories anyway). These reporters are created ONCE, at the start of the entire test run. These reporters much confirm to the following structure: Each method is optional.onBegin
- called at the very start of the testing process.beforeSuite
- called before the first test in each@suite
beforeDescribe
- called before the first test in each@describe
blockbeforeIt
- called before each@it()
test. If the test is parameterized, will be called once for each parameterized combo. To help better reporting with parameterized tests, will include some form ofisParameterized
andindex
so you can report a header at the start of a parameterized@it
group.afterIt
- called after each@it
. Same rules asbeforeIt
afterDescribe
- called after the final test in this@describe
block finishesafterSuite
- called after the final test in this@suite
finishesonEnd
- called when the entire testing process is finishedThe text was updated successfully, but these errors were encountered: