(run: (statePath: string) => Promise<void>)
| 13 | } |
| 14 | |
| 15 | async 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 | |
| 26 | describe("startup update notice", () => { |
| 27 | test("prefers latest for stable installs when latest is newer", async () => { |
no test coverage detected