Browse Source

tests: add waitSeconds method

Sasha Szpakowski 1 year ago
parent
commit
6715bae0c3
1 changed files with 8 additions and 0 deletions
  1. 8 0
      testing/classes/TestMethod.lua

+ 8 - 0
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}