-
Notifications
You must be signed in to change notification settings - Fork 235
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
Test may pass test cases which should be fail #703
Comments
Thanks for pointing this out! We'd love to get a PR! :-) |
someblue
added a commit
to someblue/codelyzer
that referenced
this issue
Aug 24, 2018
someblue
added a commit
to someblue/codelyzer
that referenced
this issue
Aug 24, 2018
mgechev
pushed a commit
that referenced
this issue
Aug 24, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
Test may pass test cases which should be fail, if test case use
assertAnnotated/assertFailure
.Reproduce
Change any test case using
assertAnnotated/assertFailure
to a wrong case deliberately and executenpm run test
.For example, change the first failure case in test/bananaInBoxRule.ts
to
This template doesn't violate rule and assert should fail and Chai report test fail. However, Chai report all test passes.
Reason
Chai is work by exception. assertFailure catch the exception, cause Chai didn't detect the failed assertion.
Here is the code snippet: https://github.com/mgechev/codelyzer/blob/master/test/testHelper.ts#L236-L251
Seem like PR #659 broke it.
I'm new to Codelyzer and not sure if it is a bug. If it's not a bug, please close this issue. If it's a bug, I'm pleasure to make a PR to fix it 😁
The text was updated successfully, but these errors were encountered: