Skip to content

Conversation

@eugef
Copy link
Owner

@eugef eugef commented Apr 23, 2025

Fixes #316

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables dual support for accessing request headers in both Express.js and Web API (Next.js) styles by introducing a new Headers implementation and updating the mockRequest object accordingly.

  • Fixed a spelling mistake in test descriptions.
  • Updated tests to verify header access via the new Headers interface.
  • Integrated the new createHeaders function into mockRequest and provided comprehensive tests in headers.spec.js.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

File Description
test/lib/mockRequest.spec.ts Spelling fix in test description and updated assertions for headers.get.
test/lib/headers.spec.js Added tests for the new Headers implementation and its methods.
lib/mockRequest.js Updated to use createHeaders for header initialization.
lib/headers.js New file implementing a Headers proxy with both Express.js and Web API support.
Comments suppressed due to low confidence (1)

test/lib/mockRequest.spec.ts:45

  • Correct the typo in the test description: change 'shoud' to 'should'.
it('shoud initialize with default options', () => {

@eugef eugef merged commit a63a9c6 into master Apr 27, 2025
6 checks passed
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.

creating a mockrequest with a header from the options does not allow getting the header according in the standard way.

2 participants