From 9c6090a208232a02d24817657433250bdb96ac5d Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Tue, 12 May 2026 14:21:31 +0900 Subject: [PATCH] test: add typed test coercion helper Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/testing/test-coerce-global.d.ts | 5 +++++ test-setup.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 src/testing/test-coerce-global.d.ts diff --git a/src/testing/test-coerce-global.d.ts b/src/testing/test-coerce-global.d.ts new file mode 100644 index 000000000..cc1e618be --- /dev/null +++ b/src/testing/test-coerce-global.d.ts @@ -0,0 +1,5 @@ +declare global { + function testCoerce(value: TValue): TValue +} + +export {} diff --git a/test-setup.ts b/test-setup.ts index e66350edb..6fbecdd57 100644 --- a/test-setup.ts +++ b/test-setup.ts @@ -11,6 +11,8 @@ const { restoreModuleMocks } = installModuleMockLifecycle(mock) let environmentSnapshot: NodeJS.ProcessEnv = { ...process.env } let workingDirectorySnapshot = process.cwd() +globalThis.testCoerce = (value: TValue): TValue => value + function cleanupOmoCacheDir(cacheDir: string): void { rmSync(cacheDir, { recursive: true, force: true }) }