diff --git a/scripts/data/integration_tests/test_lua_api/builtin.omwscripts b/scripts/data/integration_tests/test_lua_api/builtin.omwscripts deleted file mode 100644 index 8b7db327c5..0000000000 --- a/scripts/data/integration_tests/test_lua_api/builtin.omwscripts +++ /dev/null @@ -1 +0,0 @@ -# It is an empty file that overrides builtin.omwscripts and disables builtin scripts diff --git a/scripts/data/integration_tests/test_lua_api/player.lua b/scripts/data/integration_tests/test_lua_api/player.lua index 45a3d1bf2e..95e35e7dd9 100644 --- a/scripts/data/integration_tests/test_lua_api/player.lua +++ b/scripts/data/integration_tests/test_lua_api/player.lua @@ -220,7 +220,7 @@ testing.registerLocalTest('findNearestNavMeshPosition', return { engineHandlers = { - onUpdate = testing.updateLocal, + onFrame = testing.updateLocal, }, eventHandlers = testing.eventHandlers } diff --git a/scripts/data/integration_tests/test_lua_api/test.omwscripts b/scripts/data/integration_tests/test_lua_api/test.omwscripts index 97f523afbd..80507392f7 100644 --- a/scripts/data/integration_tests/test_lua_api/test.omwscripts +++ b/scripts/data/integration_tests/test_lua_api/test.omwscripts @@ -1,3 +1,2 @@ GLOBAL: test.lua PLAYER: player.lua - diff --git a/scripts/data/integration_tests/testing_util/testing_util.lua b/scripts/data/integration_tests/testing_util/testing_util.lua index 4889b40898..2fa1892037 100644 --- a/scripts/data/integration_tests/testing_util/testing_util.lua +++ b/scripts/data/integration_tests/testing_util/testing_util.lua @@ -31,8 +31,12 @@ function M.runLocalTest(obj, name) currentLocalTest = name currentLocalTestError = nil obj:sendEvent('runLocalTest', name) - while currentLocalTest do coroutine.yield() end - if currentLocalTestError then error(currentLocalTestError, 2) end + while currentLocalTest do + coroutine.yield() + end + if currentLocalTestError then + error(currentLocalTestError, 2) + end end function M.expect(cond, delta, msg) @@ -181,7 +185,9 @@ end function M.updateLocal() if localTestRunner and coroutine.status(localTestRunner) ~= 'dead' then - coroutine.resume(localTestRunner) + if not core.isWorldPaused() then + coroutine.resume(localTestRunner) + end else localTestRunner = nil end @@ -196,7 +202,9 @@ M.eventHandlers = { end localTestRunner = coroutine.create(function() local status, err = pcall(fn) - if status then err = nil end + if status then + err = nil + end core.sendGlobalEvent('localTestFinished', {name=name, errMsg=err}) end) end,