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

Apex Class Test with asserts flagged as without asserts #485

Closed
VinceFINET opened this issue Jan 8, 2025 · 1 comment
Closed

Apex Class Test with asserts flagged as without asserts #485

VinceFINET opened this issue Jan 8, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@VinceFINET
Copy link
Collaborator

Describe the bug
My class has asserts but is flagged as without asserts in org check

To Reproduce
Create an apex test class.
Add for example the only. assert in the code:
System.assertEquals('this', 'that', 'This is an example');
Open Org Check, refresh the apex tab and you see the test "has" assert no issue (yet).
Then go back to the class and add a space before the opening parenthesis like this:
System.assertEquals ('this', 'that', 'This is an example');
Go back to Org Check, refresh the data and on the apex test unit tab now the same test appears to not have ANY assert.

Seems the RegEx that is used to check assert usage is not taking the spaces in consideration.

@VinceFINET VinceFINET added the bug Something isn't working label Jan 8, 2025
@VinceFINET VinceFINET added this to the Version Boron [B, 5] milestone Jan 8, 2025
@VinceFINET VinceFINET self-assigned this Jan 8, 2025
@VinceFINET
Copy link
Collaborator Author

Same error if the annotation IsTest with see all data is used
If there is a space between IsTest and the opening parenthesis, then org check does not see the test as see all data
need to change the regex matcher

@VinceFINET VinceFINET changed the title Apex Class Test with asserts flaged as without asserts Apex Class Test with asserts flagged as without asserts Jan 8, 2025
VinceFINET added a commit that referenced this issue Jan 8, 2025
VinceFINET added a commit that referenced this issue Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant