-
Notifications
You must be signed in to change notification settings - Fork 162
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
feat: changes to success criteria checks display #1943
base: feat/introduce-respect
Are you sure you want to change the base?
feat: changes to success criteria checks display #1943
Conversation
|
Coverage report
Show files with reduced coverage 🔻
Test suite run success1323 tests passing in 189 suites. Report generated by 🧪jest coverage report action from 4a00fd9 |
@@ -271,6 +271,7 @@ export type Check = { | |||
name: string; | |||
message?: string; | |||
additionalMessage?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might also reuse additionalMessage
, but imho having criteriaCondition
is better describes the concept and will be more useful in json logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it looks like additionalMessage
is a better option since it serves the same exact purpose for checks derived from OpenAPI description in checkStatusCodeFromDescription
.
check.criteriaCondition.length > MAX_CRITERIA_CONDITION_DISPLAY_LENGTH | ||
? check.criteriaCondition.slice(0, MAX_CRITERIA_CONDITION_DISPLAY_LENGTH) + '...' | ||
: check.criteriaCondition | ||
)}` | ||
: '' | ||
}${check?.additionalMessage ? ` (${check.additionalMessage})` : ''}`; | ||
|
||
const failTestMessage = (checkName: string, severity?: RuleSeverity) => | ||
`${severity === 'warn' ? yellow('⚠') : red('✗')} ${gray(checkName.toLowerCase())}${ | ||
check?.additionalMessage ? ' (' + check.additionalMessage + ')' : '' | ||
}`; | ||
check?.criteriaCondition | ||
? ` - ${red( | ||
check.criteriaCondition.length > MAX_CRITERIA_CONDITION_DISPLAY_LENGTH | ||
? check.criteriaCondition.slice(0, MAX_CRITERIA_CONDITION_DISPLAY_LENGTH) + '...' | ||
: check.criteriaCondition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move the common logic to a utility function?
@@ -271,6 +271,7 @@ export type Check = { | |||
name: string; | |||
message?: string; | |||
additionalMessage?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it looks like additionalMessage
is a better option since it serves the same exact purpose for checks derived from OpenAPI description in checkStatusCodeFromDescription
.
What/Why/How?
Add
condition
information to each SUCCESS_CRITERIA_CHECK display output.Reference
Testing
Screenshots (optional)
Check yourself
Security