test(parse): add assertion for v6 inline reference behavior#4619
Merged
escapedcat merged 3 commits intomasterfrom Jan 31, 2026
Merged
test(parse): add assertion for v6 inline reference behavior#4619escapedcat merged 3 commits intomasterfrom
escapedcat merged 3 commits intomasterfrom
Conversation
Verify that inline references are captured in the references array, documenting the behavioral change from v5 where they remained in body.
This comment was marked as outdated.
This comment was marked as outdated.
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
This comment was marked as outdated.
This comment was marked as outdated.
Add assertions to verify that: - Both reference instances are captured (2 total) - Body content with references moves to footer - Each reference object includes the raw source line This comprehensively documents the behavioral change from v5 (references stayed in body) to v6 (references move to footer).
Member
Author
Contributor
|
Much better, but what about the "# some comment" thing? Shouldn't that be in the body? or have an empty ref? or if it's supposed to be a comment in the sense that it should not appear in commit msg (because git should ignore it), then in that case it shouldn't even reach commitlint right? |
Separate concerns for better clarity: - Test 1: Inline reference parsing (verifies v6 moves body refs to footer) - Test 2: Comment line filtering (verifies commentChar option works) This addresses co-maintainer feedback about the confusing mixed test.
Member
Author
|
Split into two tests to make this behaviour more clear
|
Contributor
|
LGTM |
This was referenced Feb 2, 2026
This was referenced Feb 22, 2026
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.
User description
Verify that inline references are captured in the references array, documenting the behavioral change from v5 where they remained in body.
PR Type
Tests
Description
Add assertion verifying inline references captured in references array
Document v6 behavioral change from v5 where references remained in body
Verify reference object contains correct issue and prefix properties
Diagram Walkthrough
File Walkthrough
index.test.ts
Add inline reference array assertion to parser test@commitlint/parse/src/index.test.ts
referencesarray
issueandprefixproperties
to references array
expect.arrayContainingandexpect.objectContainingfor flexiblematching