LearnNewsExamplesServices
Frontmatter
id8895
titleImplement Global Test Safeguard for `Neo.isDestroyed` Rejections
stateClosed
labels
enhancementaitesting
assigneestobiu
createdAtJan 27, 2026, 3:57 PM
updatedAtJan 27, 2026, 4:01 PM
githubUrlhttps://github.com/neomjs/neo/issues/8895
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 27, 2026, 4:01 PM

Implement Global Test Safeguard for Neo.isDestroyed Rejections

Closed v11.24.0 enhancementaitesting
tobiu
tobiu commented on Jan 27, 2026, 3:57 PM

Context

Unit tests frequently fail with "Unhandled Rejection: Symbol(Neo.isDestroyed)" when components are destroyed during teardown (e.g., afterEach) while async operations (timeouts, updates) are still pending.

Solution

Implement a global interceptor in test/playwright/setup.mjs that patches process.emit.

Logic

If name === 'unhandledRejection' and data === Symbol.for('Neo.isDestroyed'), suppress the event (return true). Otherwise, delegate to original behavior.

Why

This provides a centralized, robust way to handle expected cleanup noise without "monkey patching" individual component methods or tests, ensuring clean test execution.

tobiu added the enhancement label on Jan 27, 2026, 3:57 PM
tobiu added the ai label on Jan 27, 2026, 3:57 PM
tobiu added the testing label on Jan 27, 2026, 3:57 PM
tobiu referenced in commit f634f0c - "enhancement: Implement global test safeguard for Neo.isDestroyed unhandled rejections (#8895)" on Jan 27, 2026, 4:00 PM
tobiu
tobiu Jan 27, 2026, 4:00 PM

Input from Gemini 3 Pro:

✦ I have implemented the global test safeguard in test/playwright/setup.mjs by patching process.emit to suppress Neo.isDestroyed unhandled rejections.

I verified the fix by running the full unit test suite (npm run test-unit), which passed successfully (258 tests passed).

This approach provides a robust, centralized solution without needing to patch individual component methods.

tobiu assigned to @tobiu on Jan 27, 2026, 4:01 PM
tobiu closed this issue on Jan 27, 2026, 4:01 PM