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 passing in assertion message to assertArray #210

Merged
merged 2 commits into from
Sep 6, 2024

Conversation

marlun78
Copy link
Contributor

@marlun78 marlun78 commented Sep 6, 2024

As assertArray previously called the assertion function in a forEach(assertion), the index was passed as the custom message. This PR fixes this bug by passing down the message argument to the assertion function.

As `assertArray` previously called the assertion
function in a `forEach(assertion)`, the index was
passed as the custom message. This commit fixes
this bug by passing down the `message` argument
to the assertion function.

A `@ts-expect-error` comment was added to due to
"Assertions require every name in the call target
to be declared with an explicit type
annotation.".
@sindresorhus sindresorhus changed the title Fix index-as-message bug in assertArray Fix passing in assertion message to assertArray Sep 6, 2024
@sindresorhus sindresorhus merged commit 5565c5e into sindresorhus:main Sep 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants