mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +00:00
feat: add mock and spy utilities facade with module re-exports for backward compatibility
This commit is contained in:
30
packages/lua_test/seed/scripts/mocks.lua
Normal file
30
packages/lua_test/seed/scripts/mocks.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
-- Mock and spy utilities facade
|
||||
-- Re-exports all mock modules for backward compatibility
|
||||
--
|
||||
-- Split into focused modules:
|
||||
-- mock_fn.lua - Mock function creator (fn)
|
||||
-- spy.lua - Method spying (spyOn)
|
||||
-- mock_object.lua - Mock object creator (mockObject)
|
||||
-- fake_timers.lua - Timer mocks (useFakeTimers)
|
||||
|
||||
local mock_fn = require("mock_fn")
|
||||
local spy = require("spy")
|
||||
local mock_object = require("mock_object")
|
||||
local fake_timers = require("fake_timers")
|
||||
|
||||
---@class MocksModule
|
||||
local M = {}
|
||||
|
||||
-- Re-export mock function
|
||||
M.fn = mock_fn.fn
|
||||
|
||||
-- Re-export spy
|
||||
M.spyOn = spy.spyOn
|
||||
|
||||
-- Re-export mock object
|
||||
M.mockObject = mock_object.mockObject
|
||||
|
||||
-- Re-export fake timers
|
||||
M.useFakeTimers = fake_timers.useFakeTimers
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user