From 6715bae0c30e0914af27dd5c3f4813c5d261a2e1 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Tue, 12 Dec 2023 19:53:56 -0400 Subject: [PATCH] tests: add waitSeconds method --- testing/classes/TestMethod.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/testing/classes/TestMethod.lua b/testing/classes/TestMethod.lua index 9fec5e42d..f4f8688d6 100644 --- a/testing/classes/TestMethod.lua +++ b/testing/classes/TestMethod.lua @@ -372,6 +372,14 @@ TestMethod = { end, + waitSeconds = function(self, seconds) + local start = love.timer.getTime() + while love.timer.getTime() < start + seconds do + coroutine.yield() + end + end, + + -- @method - TestMethod:evaluateTest() -- @desc - evaluates the results of all assertions for a final restult -- @return {nil}