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

Allow expectError assertions to detect Expected at least arguments error #126

Merged
merged 1 commit into from
Oct 12, 2021
Merged

Allow expectError assertions to detect Expected at least arguments error #126

merged 1 commit into from
Oct 12, 2021

Conversation

mrazauskas
Copy link
Contributor

Currently expectError does not silence "Expected at least {0} arguments, but got {1}. ts(2555)" error (similar 2554 is silenced). For example:

// declaration
export function atLeastOne(...expected: [unknown, ...Array<unknown>]): void;

//test
expectError(atLeastOne())

Will fail with:

✖  4:0   Expected an error, but found none.         
✖  4:21  Expected at least 1 arguments, but got 0.  

This PR is adding 2555 to the list of silence errors. With this patch, the test above will pass.

@BendingBender BendingBender merged commit 293ff33 into tsdjs:main Oct 12, 2021
@mrazauskas mrazauskas deleted the ignore-error-expected-at-least-arguments branch October 12, 2021 17:17
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.

3 participants