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

Test Marked As Passed Even If Different Error Type Is Returned #18

Open
mr-feek opened this issue Jul 19, 2020 · 2 comments
Open

Test Marked As Passed Even If Different Error Type Is Returned #18

mr-feek opened this issue Jul 19, 2020 · 2 comments

Comments

@mr-feek
Copy link
Contributor

mr-feek commented Jul 19, 2020

👋 I noticed that my Codeception tests pass even if I expect a different type of error from psalm.

Steps To Reproduce
Write a gherkin test snippet and include Then I see these errors in the test. Expect a specific error such as | MissingFile | Cannot find file | when require_once file/that/doesn't/exist.php is analyzed.

An example is here: psalm/psalm-plugin-laravel@d69377b#diff-dc52f1aabf7e9388e148c112a4b349c1R32

Expected

  • Test fails because UnresolvableInclude was returned by psalm instead of the expected MissingFile

Actual

  • Test passes
@mr-feek
Copy link
Contributor Author

mr-feek commented Jul 19, 2020

I just realized I have the wrong syntax. I didn't include | Type | Message in my assertion. Should we complain loudly about that to avoid a false positive like what I ran into?

@weirdan
Copy link
Member

weirdan commented Jul 19, 2020

First line of the table element is ignored because I thought it would be useful to have headers. | Type | Message | is just a convention.

Perhaps the module should complain when:

  • there's just one row in the table
  • the first cell contains a known error type (indicating that header row was omitted)

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

No branches or pull requests

2 participants