Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Test may pass test cases which should be fail #703

Copy link
Copy link

Description

@someblue
Issue body actions

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 execute npm run test.

For example, change the first failure case in test/bananaInBoxRule.ts

template: \` <input type="text" ([ngModel])="foo" name="foo">

to

template: \` <input type="text" [(ngModel)]="foo" name="foo">

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 😁

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.