-
-
Notifications
You must be signed in to change notification settings - Fork 161
fix(runtime): render node:test reporter directives #9914
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
Closed
proggeramlug
wants to merge
1
commit into
PerryTS:main
from
proggeramlug:fix/9202-test-reporter-directives
+71
−4
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Render `skip` and `todo` directives in the `node:test` spec and TAP reporters, | ||
| including Node-compatible markers and optional directive reasons. |
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
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
Oops, something went wrong.
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.
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.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 8685
🌐 Web query:
Node.js v26.5.1 lib/internal/test_runner/reporter/tap.js directive reason escaping💡 Result:
In Node.js, the TAP reporter (located at lib/internal/test_runner/reporter/tap.js) implements character escaping to ensure that test names and diagnostic information generate valid Test Anything Protocol (TAP) output [1][2]. This is critical because certain characters, such as the backslash (
\) and the hash (#), have special significance in TAP formatting [1][3]. ThetapEscapefunction, which handles this process, specifically escapes characters to prevent them from breaking the TAP stream structure [1][2]. The implementation follows a specific order of operations to correctly handle escape sequences: 1. It escapes control characters and common escape sequences: - Backspace (\b) becomes\\b[1][2] - Form feed (\f) becomes\\f[1][2] - Tab (\t) becomes\\t[1][2] - Newline (\n) becomes\\n[1][2] - Carriage return (\r) becomes\\r[1][2] - Vertical tab (\v) becomes\\v[1][2] 2. It then handles structural TAP characters, ensuring they are escaped last so that they are not inadvertently processed as part of a previous escape sequence [1]: - Backslash (\) is escaped to\\[1][2] - Hash (#) is escaped to\#[1][2] This logic ensures that metadata, such as directive reasons (e.g., in askiportododirective), are properly serialized into the TAP output without compromising the protocol's integrity [1][2][4]. The escaping mechanism was refined over several releases to ensure consistency across different test execution modes, such as when using or not using the --test flag [1][5].Citations:
🤖 get_repo_knowledge executed:
get_repo_knowledge PerryTS/perry /tmp/coderabbit-repo-knowledge/perryts-perry-d4a878bc/learnings /tmp/coderabbit-repo-knowledge/perryts-perry-d4a878bc/conventionsLength of output: 35413
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 260
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 3597
Escape TAP directive reasons before output.
directive_suffixwritesreasondirectly into the TAP line. Apply Node.js 26.5.1 TAP escaping before interpolation so#,\, and control characters do not change the TAP output.🤖 Prompt for AI Agents
Source: MCP tools