Skip to content
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

test(format/html): reenable snapshot tests #3979

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/biome_html_formatter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ biome_formatter_test = { workspace = true }
biome_fs = { workspace = true }
biome_html_parser = { workspace = true }
biome_parser = { workspace = true }
biome_service = { workspace = true }
biome_service = { workspace = true, features = ["experimental-html"] }
countme = { workspace = true, features = ["enable"] }
tests_macros = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion crates/biome_html_formatter/tests/prettier_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use biome_html_syntax::HtmlFileSource;

mod language;

tests_macros::gen_tests! {"tests/specs/prettier/**/*.html", crate::test_snapshot, "script"}
tests_macros::gen_tests! {"tests/specs/prettier/**/*.html", crate::test_snapshot, ""}

#[allow(dead_code)]
fn test_snapshot(input: &'static str, _: &str, _: &str, _: &str) {
Expand Down
4 changes: 2 additions & 2 deletions crates/biome_html_formatter/tests/spec_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ mod language {
/// * `json/null` -> input: `tests/specs/json/null.json`, expected output: `tests/specs/json/null.json.snap`
/// * `null` -> input: `tests/specs/null.json`, expected output: `tests/specs/null.json.snap`
pub fn run(spec_input_file: &str, _expected_file: &str, test_directory: &str, _file_type: &str) {
let root_path = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/specs/"));
let root_path = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/specs/html"));

let Some(test_file) = SpecTestFile::try_from_file(spec_input_file, root_path, None) else {
return;
panic!("Failed to set up snapshot test");
};

let source_type: HtmlFileSource = test_file.input_file().as_path().try_into().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_html_formatter/tests/spec_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ mod spec_test;
mod formatter {

mod html {
tests_macros::gen_tests! {"tests/specs/**/*.html", crate::spec_test::run, ""}
tests_macros::gen_tests! {"tests/specs/html/**/*.html", crate::spec_test::run, ""}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_formatter_test/src/snapshot_builder.rs
info: attributes-break.html
info: attributes/break.html
---
# Input

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_formatter_test/src/snapshot_builder.rs
info: attributes-no-break.html
info: attributes/no-break.html
---
# Input

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_formatter_test/src/snapshot_builder.rs
info: attributes-self-closing.html
info: attributes/self-closing.html
---
# Input

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_formatter_test/src/snapshot_builder.rs
info: attributes-single-quotes.html
info: attributes/single-quotes.html
---
# Input

Expand All @@ -25,4 +25,4 @@ Attribute Position: Auto
-----

```html
<img src="foo.png" alt='should keep "these" quotes' />```
<img src="foo.png'" alt='should keep "these" quotes' />```
Loading