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

Core: Only pass internal argument to test callback when using each() #1620

Merged
merged 1 commit into from
Jun 5, 2021

Conversation

Krinkle
Copy link
Member

@Krinkle Krinkle commented Jun 5, 2021

This restores previous behaviour to avoid breaking plugins that might
already extend or monkey-patch QUnit to add additional parameters to
the test callback.

Also:

  • Declare the params setting in the Test class for added clarity, and to ensure a consistent object shape.

  • Make more use of the new addTest() function that was added in Core: Add test.each. #1569, this reduces a lot of duplication. Thanks @ventuno!

    While at it, I shifted the abstraction slightly to expose the Test class settings directly, thus making the addTest() mainly
    be responsible for the queuing and filtering, and no longer responsible for formatting the Test class settings.

    With the added use of ES2015 shorthand property name syntax, this feels almost identical using function parameters.

This restores previous behaviour to avoid breaking plugins that might
already extend or monkey-patch QUnit to add additional parameters to
the test callback.

Also:

* Declare the params setting in the Test class for added clarity,
  and to ensure a consistent object shape.

* Make more use of the new `addTest()` function that was added in
  #1569, this reduces a lot
  of duplication.

  While at it, I shifted the abstraction slightly to expose the
  Test class settings directly, thus making the `addTest()` mainly
  be responsible for the queuing and filtering, and no longer
  responsible for formatting the Test class settings.

  The use of ES2015 shorthand property name syntax makes feel
  almost identical to the function parameter signature.
@Krinkle Krinkle mentioned this pull request Jun 5, 2021
@Krinkle Krinkle merged commit 835b7c1 into main Jun 5, 2021
@Krinkle Krinkle deleted the test-arg branch June 5, 2021 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant