Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getNumberOfParameters utility function #2473

Merged
merged 5 commits into from Oct 26, 2022

Conversation

thiagomini
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

The getNumberOfArguments utility function returned an incorrect number when the function's body contained something inside the parenthesis.

Issue Number: #2452

What is the new behavior?

The getNumberOfArguments function now ignores the function's body.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

I tested locally if this change actually fixed the problem of Durable Providers not working for GraphQL resolvers. However, I can't create an automated test for the repo here because it still relies on NestJS Version 8, so we don't have the durable attribute as a Scope option.

ensure getNumberOfArguments returns the correct number of arguments for functions with body that use parenthesis.
create additional tests to ensure the arguments count is correct for all types of functions with and without body
add test for unsupported case for documentation's sake.
@kamilmysliwiec kamilmysliwiec merged commit 8dc5123 into nestjs:master Oct 26, 2022
@kamilmysliwiec
Copy link
Member

lgtm

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.

None yet

2 participants