fix(@schematics/angular): safely comment out multiline statements in refactor-jasmine-vitest - #33315
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a helper function addCommentedNodeText to safely comment out multi-line TypeScript AST nodes line-by-line, preventing syntax issues when converting them to single-line comments. This helper is integrated into several transformers (jasmine-lifecycle, jasmine-matcher, and jasmine-misc) and unit tests are added. The feedback suggests avoiding the inline require statement in the unit tests and instead using standard ES imports at the top of the file for consistency.
…refactor-jasmine-vitest When refactoring unsupported or empty statements (such as `pending()`, `expect().nothing()`, and certain `jasmine` member assignments), the schematic previously commented out the code using a single-line comment prefix on the full text of the node. If the statement spanned multiple lines, only the first line was commented, leaving subsequent lines uncommented. This resulted in invalid syntax or unexpected compile errors.
0fe72e1 to
f0b8109
Compare
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When refactoring unsupported or empty statements (such as
pending(),expect().nothing(), and certainjasminemember assignments), the schematic previously commented out the code using a single-line comment prefix on the full text of the node. If the statement spanned multiple lines, only the first line was commented, leaving subsequent lines uncommented. This resulted in invalid syntax or unexpected compile errors.