Skip to content

Conversation

@pranitaurlam
Copy link

@pranitaurlam pranitaurlam commented Feb 3, 2026

Description

Added documentation explaining that the "Jest did not exit one second after the test run" warning is harmless when all tests pass.

This helps new contributors understand the warning is expected behavior and not an indication of a problem.

Changes Made

  • Added a note in the Testing > Frontend section of CONTRIBUTING.md

Files Affected

  • CONTRIBUTING.md

Fixes #1137

Summary by CodeRabbit

  • Documentation
    • Clarified contributor guidelines (Frontend Testing): notes that the “Jest did not exit…” warning can be expected when tests pass and added troubleshooting guidance to detect open handles and ensure proper test teardown.

Added documentation explaining that the 'Jest did not exit one second
after the test run' warning is harmless when all tests pass.

This helps new contributors understand the warning is expected behavior
and not an indication of a problem.

Fixes AOSSIE-Org#1137
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

Added a note to CONTRIBUTING.md (Frontend Testing) stating that the Jest warning "Jest did not exit one second after the test run has completed." can be expected when tests pass; includes guidance to run npx jest --detectOpenHandles and ensure proper teardown to find open handles.

Changes

Cohort / File(s) Summary
Frontend Testing Documentation
CONTRIBUTING.md
Inserted clarification in Frontend Testing section that the Jest exit warning can be harmless when tests pass; added guidance to run npx jest --detectOpenHandles and verify proper teardown to locate root causes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 I hopped through docs to make things bright,
A tiny note to calm the fright,
When Jest leaves traces after the run,
Run the detector and you’re nearly done,
Tests are green — the rabbit says: delight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding documentation about a Jest warning message.
Linked Issues check ✅ Passed The PR fully addresses the issue #1137 objectives by documenting that the Jest warning is expected when tests pass and providing guidance on debugging with --detectOpenHandles.
Out of Scope Changes check ✅ Passed The changes are entirely in scope, modifying only CONTRIBUTING.md to add documentation as required by issue #1137 with no unrelated alterations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@pranitaurlam
Copy link
Author

Hi @rahulharpal1603,

I have raised a PR for this issue implementing the documentation for the Jest warning.
Please review and verify. Thanks!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@CONTRIBUTING.md`:
- Around line 68-69: Update the "Jest did not exit one second after the test run
has completed." paragraph in CONTRIBUTING.md to state that Jest reports "open
handles" (which can be unclosed servers, DB connections, sockets, timers, or
file watchers) that keep the Node process alive, that this can indicate resource
leaks and should be investigated rather than ignored, and add guidance to run
"npx jest --detectOpenHandles" and to close resources in test teardown (use
afterEach/afterAll) to fix the root cause.
🧹 Nitpick comments (1)
CONTRIBUTING.md (1)

67-69: Consider linking to additional context.

To provide contributors with more information if they want to investigate further, you could optionally add a reference to issue #1137 or Jest's documentation about async operations.

📚 Optional enhancement with reference link
 > **Note:** After running the frontend tests, you may see a warning:
 > `Jest did not exit one second after the test run has completed.`
-> This is a known behavior and **does not indicate a problem** when all tests pass. It occurs due to async handles that Jest detects but doesn't affect test results or application functionality.
+> This is a known behavior and **does not indicate a problem** when all tests pass. It occurs due to async handles that Jest detects but doesn't affect test results or application functionality. See [issue `#1137`](https://github.com/AOSSIE-Org/PictoPy/issues/1137) for more details.

- Changed 'async handles' to 'open handles' for accuracy
- Added examples of open handles (unclosed servers, DB connections, timers)
- Added npx jest --detectOpenHandles command for debugging
- Mentioned proper resource cleanup in afterEach/afterAll

Addresses code review feedback
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.

DOC: Jest warning shown after successful frontend tests (“Jest did not exit one second after the test run”)

1 participant