MCPcopy Create free account
hub / github.com/modem-dev/hunk / withTempStatePath

Function withTempStatePath

src/core/updateNotice.test.ts:15–24  ·  view source on GitHub ↗
(run: (statePath: string) => Promise<void>)

Source from the content-addressed store, hash-verified

13}
14
15async function withTempStatePath(run: (statePath: string) => Promise<void>) {
16 const stateDir = mkdtempSync(join(tmpdir(), "hunk-startup-notice-"));
17 const statePath = join(stateDir, "state.json");
18
19 try {
20 await run(statePath);
21 } finally {
22 rmSync(stateDir, { recursive: true, force: true });
23 }
24}
25
26describe("startup update notice", () => {
27 test("prefers latest for stable installs when latest is newer", async () => {

Callers 1

Calls 1

runFunction · 0.50

Tested by

no test coverage detected