test: add typed test coercion helper
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
declare global {
|
||||||
|
function testCoerce<TValue>(value: TValue): TValue
|
||||||
|
}
|
||||||
|
|
||||||
|
export {}
|
||||||
@@ -11,6 +11,8 @@ const { restoreModuleMocks } = installModuleMockLifecycle(mock)
|
|||||||
let environmentSnapshot: NodeJS.ProcessEnv = { ...process.env }
|
let environmentSnapshot: NodeJS.ProcessEnv = { ...process.env }
|
||||||
let workingDirectorySnapshot = process.cwd()
|
let workingDirectorySnapshot = process.cwd()
|
||||||
|
|
||||||
|
globalThis.testCoerce = <TValue>(value: TValue): TValue => value
|
||||||
|
|
||||||
function cleanupOmoCacheDir(cacheDir: string): void {
|
function cleanupOmoCacheDir(cacheDir: string): void {
|
||||||
rmSync(cacheDir, { recursive: true, force: true })
|
rmSync(cacheDir, { recursive: true, force: true })
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user