Skip to content

Commit

Permalink
Add guards to reflect methods being optional
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-j-soares committed Apr 9, 2024
1 parent bb476a6 commit 8f522dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions framework/src/source/TestRunner.bs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ namespace rooibos
public function run()

for each reporter in m.testReporters
reporter.onBegin()
if rooibos.common.isFunction(reporter.onBegin)
reporter.onBegin()
end if
end for

rooibosTimer = createObject("roTimespan")
Expand Down Expand Up @@ -104,7 +106,9 @@ namespace rooibos
m.stats.time = rooibosTimer.totalMilliseconds()

for each reporter in m.testReporters
reporter.onEnd(m.stats)
if rooibos.common.isFunction(reporter.onEnd)
reporter.onEnd(m.stats)
end if
end for

rooibosResult = {
Expand Down

0 comments on commit 8f522dd

Please sign in to comment.