test(formatter): port printer tests from Biome#15358
Conversation
CodSpeed Performance ReportMerging #15358 will not alter performanceComparing Summary
Footnotes
|
1891953 to
2a64afb
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request adds comprehensive unit tests for the printer module in the oxc_formatter crate and introduces a helper method to simplify test context creation.
- Adds 16 new test cases covering various printer functionality including groups, indentation, line breaks, fills, and line suffixes
- Introduces
FormatContext::dummy()helper method to streamline test setup - Refactors
Document::Displayimplementation to use the newdummy()method
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/oxc_formatter/src/formatter/printer/mod.rs | Adds comprehensive test suite for printer functionality including grouping, indentation, line breaking, and special formatting cases |
| crates/oxc_formatter/src/formatter/context.rs | Introduces dummy() helper method for creating test contexts with default values |
| crates/oxc_formatter/src/formatter/format_element/document.rs | Simplifies Display implementation by using the new FormatContext::dummy() method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
Copied from https://github.com/biomejs/biome/blob/ceed34a164cc76406baf617000b8877160f0bcc3/crates/biome_formatter/src/printer/mod.rs#L1389-L1833 and tweaked a little bit to fit our architecture.
2a64afb to
78abaff
Compare

Copied from https://github.com/biomejs/biome/blob/ceed34a164cc76406baf617000b8877160f0bcc3/crates/biome_formatter/src/printer/mod.rs#L1389-L1833 and tweaked a little bit to fit our architecture.