Make the first prettier test pass

This commit is contained in:
Kirill Bulatov 2023-10-12 12:40:35 +03:00
parent a528c6c686
commit 7f4ebf50d3
4 changed files with 124 additions and 29 deletions

View file

@ -71,6 +71,9 @@ impl Prettier {
".editorconfig",
];
#[cfg(any(test, feature = "test-support"))]
pub const FORMAT_SUFFIX: &str = "\nformatted by test prettier";
pub fn remote(
project_id: u64,
worktree_id: Option<usize>,
@ -433,7 +436,7 @@ impl Prettier {
#[cfg(any(test, feature = "test-support"))]
Self::Test(_) => Ok(buffer
.read_with(cx, |buffer, cx| {
let formatted_text = buffer.text() + "\nformatted by test prettier";
let formatted_text = buffer.text() + Self::FORMAT_SUFFIX;
buffer.diff(formatted_text, cx)
})
.await),