Skip to content

Commit

Permalink
Fixed a bug where crashes in node tests would stall rooibos (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron authored Mar 4, 2025
2 parents 023a363 + 143c2a4 commit 64ccc45
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions framework/src/source/rooibos/BaseTestSuite.bs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ namespace rooibos
catch error
'bs:disable-next-line
m.currentResult.crash("test crashed!", error)
if rooibos.promises.isPromise(test.deferred)
rooibos.promises.reject(error, test.deferred)
end if
end try
else
test.run()
Expand Down
11 changes: 11 additions & 0 deletions tests/src/source/Async.spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,16 @@ namespace tests

delayCall(0.02, SetLabelText)
end function

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@describe("Crashes in Node tests")
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

@async
@it("should capture the crash and fail")
function _()
throw "some error in node tests"
end function

end class
end namespace

0 comments on commit 64ccc45

Please sign in to comment.