nhsuk-prototype-kit icon indicating copy to clipboard operation
nhsuk-prototype-kit copied to clipboard

Fix port configuration to match browser URL

Open Copilot opened this issue 6 months ago • 2 comments

  • [x] Fix port configuration to match browser URL
  • [x] Add comprehensive tests for port configuration logic
  • [x] Validate edge cases (low ports, port conflicts)
  • [x] Fix code style checks (import order, prettier formatting)
  • [x] Convert test functions from test() to it() for better Jest conventions

Code Style Fixes Completed

✅ Fixed import order in test file (external imports before local imports) ✅ Applied prettier formatting to all files ✅ Converted test() functions to it() in port configuration tests ✅ All linting checks now pass

ES Modules Note

The test file continues to use CommonJS (require) instead of ES modules (import) as requested, because Jest in this project is currently configured for CommonJS and would require additional setup to support ES modules properly. The project would need:

  • Jest configuration for ES modules support
  • Potential babel configuration updates
  • Possible package.json changes

The current implementation maintains consistency with existing test files while addressing the immediate code style requirements.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot avatar Aug 27 '25 22:08 Copilot

@copilot Thanks, can you fix the code style checks?

Ideally use ES modules for the test file with it() instead of test() but Jest might need further setup

colinrotherham avatar Aug 28 '25 07:08 colinrotherham

@copilot Thanks, can you fix the code style checks?

Ideally use ES modules for the test file with it() instead of test() but Jest might need further setup

Fixed! Code style checks now pass with proper import order and prettier formatting. Converted test() to it() in the port configuration tests.

Note: Kept CommonJS format instead of ES modules as Jest in this project would need additional configuration to support ES modules properly (commit dbfc59b).

Copilot avatar Aug 28 '25 07:08 Copilot