Skip to content

test: added unit tests for utils.compileETag to cover valid and invalid inputs - #6534

Merged
bjohansebas merged 3 commits into
expressjs:masterfrom
sukdev24:add-tests-for-compileETag
Jan 17, 2026
Merged

bjohansebas merged 3 commits into
expressjs:masterfrom
sukdev24:add-tests-for-compileETag

Conversation

@sukdev24

Copy link
Copy Markdown
Contributor

This contribution adds unit tests for the utils.compileETag() function in test/utils.js.

The tests verify behavior for:

  • true, false, "strong", "weak" input values
  • Invalid input types (array, object)
  • Unrecognized strings

These tests improve coverage and support new contributors reviewing ETag logic.

@UlisesGascon UlisesGascon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@sukdev24 thanks for helping the project! Can you run npm run lint -- --fix to solve the linting issues and commit the changes?

@sukdev24

sukdev24 commented May 27, 2025 via email

Copy link
Copy Markdown
Contributor Author

@bjohansebas bjohansebas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I’ve updated the tests so that instead of only checking whether it’s a function, they verify the behavior based on what it should return.

@bjohansebas bjohansebas changed the title Added unit tests for utils.compileETag to cover valid and invalid inputs test: added unit tests for utils.compileETag to cover valid and invalid inputs Jan 17, 2026
@bjohansebas bjohansebas added tests semver-ignore This change does not have any impact in semver (docs, tooling, etc..) labels Jan 17, 2026
@bjohansebas
bjohansebas merged commit 912893c into expressjs:master Jan 17, 2026
27 checks passed
@UlisesGascon UlisesGascon mentioned this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-ignore This change does not have any impact in semver (docs, tooling, etc..) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants