Skip to content

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

Merged
Krinkle merged 1 commit intomainfrom
test-arg
Jun 5, 2021
Merged

Core: Only pass internal argument to test callback when using each()#1620
Krinkle merged 1 commit intomainfrom
test-arg

Conversation

@Krinkle
Copy link
Copy Markdown
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