Skip to content

Refactor live-reload.test.js to follow codebase conventions #114

@melvincarvalho

Description

@melvincarvalho

Summary

The test/live-reload.test.js file was added for testing live reload functionality but doesn't follow the established testing conventions in this codebase.

Issues identified (from Copilot review)

  1. Cross-platform compatibility: Uses hardcoded /tmp instead of os.tmpdir()
  2. Test framework: Uses custom test runner instead of node:test (describe/it/before/after) like other tests
  3. Test helpers: Doesn't use test/helpers.js utilities (startTestServer, stopTestServer, etc.)
  4. Cleanup: Error handlers don't always clean up temp files/directories
  5. Port handling: Uses hardcoded port 9876 instead of port 0 with OS assignment

Suggested changes

  • Rewrite to use node:test framework
  • Use test helpers from test/helpers.js
  • Use os.tmpdir() for cross-platform temp directories
  • Add proper cleanup in all code paths
  • Consider adding public mode subscription test to test/notifications.test.js

Reference

PR #113 review comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions