Frontmatter
| id | 8895 |
| title | Implement Global Test Safeguard for `Neo.isDestroyed` Rejections |
| state | Closed |
| labels | enhancementaitesting |
| assignees | tobiu |
| createdAt | Jan 27, 2026, 3:57 PM |
| updatedAt | Jan 27, 2026, 4:01 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8895 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 27, 2026, 4:01 PM |
Implement Global Test Safeguard for Neo.isDestroyed Rejections

tobiu
Jan 27, 2026, 4:00 PM
Input from Gemini 3 Pro:
✦ I have implemented the global test safeguard in
test/playwright/setup.mjsby patchingprocess.emitto suppressNeo.isDestroyedunhandled 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
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.mjsthat patchesprocess.emit.Logic
If
name === 'unhandledRejection'anddata === Symbol.for('Neo.isDestroyed'), suppress the event (returntrue). 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.