test(cli): cover formatLintFindings and normalizeErrorMessage#1208
Open
calcarazgre646 wants to merge 1 commit into
Open
test(cli): cover formatLintFindings and normalizeErrorMessage#1208calcarazgre646 wants to merge 1 commit into
calcarazgre646 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Test coverage for two pure cli helpers that had none:
utils/lintFormat.ts(formatLintFindings): the shared console formatter behindlint,render,preview, andpublish. 12 tests covering the file-label threshold (single vs multiple files),showElementId, info suppression by default and inclusion underverbose, input-order default vserrorsFirstgrouping (info last), the indentedFix:hint line, and theshowSummaryfooter including the verbose-only info count.utils/errorMessage.ts(normalizeErrorMessage): the fallback cascade used byrendererror paths. 10 tests covering Error instances, strings, objects with and without a stringmessage, the JSON fallback, the key-list fallback for cyclic objects, theString()last resort for an object that throws from bothJSON.stringifyandObject.keys(Proxy with a throwingownKeystrap), and thenull/undefined/primitive paths.No source changes.
Notes
ProjectLintResultshape (per-file counts plus totals) rather than only the fields the formatter happens to read, so they stay valid if the formatter starts consuming more of the result.ui/colors.tsdisables ANSI when stdout is not a TTY, which holds for vitest workers locally and in CI.errorsFirstgrouping and removing themessage-property preference both produce failures).Suite: 710/710 cli.