# HG changeset patch # User Kim Alvefur # Date 1587399624 -7200 # Node ID 76c9320f69a1b5182a5ecb28638129c237233b96 # Parent dbce2b94a7eb921fdabff43313bcc631e6dcf7cb scansion: Mock time libraries during tests The passage of time does not need test coverage, just look in a mirror. diff -r dbce2b94a7eb -r 76c9320f69a1 spec/scansion/prosody.cfg.lua --- a/spec/scansion/prosody.cfg.lua Mon Apr 20 18:17:57 2020 +0200 +++ b/spec/scansion/prosody.cfg.lua Mon Apr 20 18:20:24 2020 +0200 @@ -1,5 +1,16 @@ --luacheck: ignore +-- Mock time functions to simplify tests +function _G.os.time() + return 1219439344; +end +package.preload["util.time"] = function () + return { + now = function () return 1219439344.1; end; + monotonic = function () return 0.1; end; + } +end + admins = { "admin@localhost" } use_libevent = true