Skip to content

test: enhance req.is() tests with additional cases - #6703

Open
bjohansebas wants to merge 2 commits into
masterfrom
req.is
Open

test: enhance req.is() tests with additional cases#6703
bjohansebas wants to merge 2 commits into
masterfrom
req.is

Conversation

@bjohansebas

@bjohansebas bjohansebas commented Aug 12, 2025

Copy link
Copy Markdown
Member

Basically, we support an array as an argument for req.is. This hasn’t been documented, and we should document it on the website.

Ref:

if (!Array.isArray(types)) {

@bjohansebas
bjohansebas requested a review from a team August 12, 2025 22:57
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
Comment thread test/req.is.js
Comment thread test/req.is.js
Comment thread test/req.is.js

@hamidrezaghavami hamidrezaghavami left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

your code was so structured, I mainly review it for learning purposes, well done!

Comment thread package.json
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "mocha --require test/support/env --reporter spec --check-leaks test/ test/acceptance/",
"test": "mocha --require test/support/env --exit --reporter spec --check-leaks test/ test/acceptance/",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this --exit here? The tests should work (and work for me) without it. According to Mocha docs --exit is a workaround for improper cleanup and I don't see anything wrong here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm, I don't even remember why I added that anymore, it's been quite a while since I opened this PR. But I think it was to make sure it would always close and wouldn't leave the process hanging

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There were PRs where the process would stay running indefinitely, consuming CI resources.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CI uses test-ci:

- name: Run tests
shell: bash
run: npm run test-ci

There have been no runs that have timed out in the last year. One run was cancelled after over an hour, but it seems to be a problem with one specific PR (#6742).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, and test-ci uses test. Maybe it was because of that PR, I honestly don't remember anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants