mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-29 13:43:39 +00:00
17 lines
631 B
TypeScript
17 lines
631 B
TypeScript
// Typed mock facade for session write-lock module tests.
|
|
import type * as SessionWriteLockModule from "../agents/session-write-lock.js";
|
|
|
|
type SessionWriteLockModuleShape = typeof SessionWriteLockModule;
|
|
|
|
/** Creates a session-write-lock module mock while preserving untouched exports. */
|
|
export async function buildSessionWriteLockModuleMock(
|
|
loadActual: () => Promise<SessionWriteLockModuleShape>,
|
|
acquireSessionWriteLock: SessionWriteLockModuleShape["acquireSessionWriteLock"],
|
|
): Promise<SessionWriteLockModuleShape> {
|
|
const original = await loadActual();
|
|
return {
|
|
...original,
|
|
acquireSessionWriteLock,
|
|
};
|
|
}
|