Skip to content

Remove temp directories that tests leave behind - #60

Merged
j-ctang merged 1 commit into
stagingfrom
fix/49-temp-dir-leak
Oct 28, 2026
Merged

j-ctang merged 1 commit into
stagingfrom
fix/49-temp-dir-leak

Conversation

@j-ctang

@j-ctang j-ctang commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Closes #49
Risk: risk:low

Summary

  • Add test/tempDir.ts: creates temp dirs and removes them in afterAll.
  • Switch the nine leaking test files to the helper. Assertions unchanged.
  • Cleanup also runs when a test fails. No src/ or config changes.

Before/After

jev-* entries left after one npx jest --runInBand with a fresh TMPDIR:

before (staging 4643abb): 43
after:                    0

Real os.tmpdir(), counted before and after npm test: 12940 -> 12940 (no new entries). With a planted failure in savedChoice.test.ts, the run fails and leaves 0 jev-* dirs. npm run check passes.

Commit History

  • Remove temp directories that tests leave behind

Sensitive Changes

None.

Rollback

git revert <merge-sha>

- Add tempDir helper with afterAll cleanup
- Use it in nine leaking test files

Signed-off-by: j-ctang <272994374+j-ctang@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@j-ctang

j-ctang commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

Verdict: Ready to merge

Review tier: S

No blocking findings.

Follow-ups (outside this PR):

  • I reviewed the code and supplied verification evidence; I did not rerun tests because this review forbids commands that write.

@j-ctang
j-ctang merged commit bc12b32 into staging Oct 28, 2026
3 checks passed
@j-ctang
j-ctang deleted the fix/49-temp-dir-leak branch October 28, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant