From 9c054749d72fbc54cdad5b381d6955bcdb30b592 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Wed, 11 Dec 2024 17:24:19 +0000 Subject: [PATCH] fix tests --- crates/biome_js_analyze/tests/spec_tests.rs | 2 +- crates/biome_js_formatter/tests/spec_test.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/biome_js_analyze/tests/spec_tests.rs b/crates/biome_js_analyze/tests/spec_tests.rs index 9a14987c4b4b..7c289b690e58 100644 --- a/crates/biome_js_analyze/tests/spec_tests.rs +++ b/crates/biome_js_analyze/tests/spec_tests.rs @@ -5,7 +5,7 @@ use biome_diagnostics::advice::CodeSuggestionAdvice; use biome_diagnostics::{DiagnosticExt, Severity}; use biome_fs::OsFileSystem; use biome_js_parser::{parse, JsParserOptions}; -use biome_js_syntax::{JsFileSource, JsLanguage, LanguageVariant, ModuleKind}; +use biome_js_syntax::{JsFileSource, JsLanguage, ModuleKind}; use biome_plugin_loader::AnalyzerGritPlugin; use biome_project::PackageType; use biome_rowan::AstNode; diff --git a/crates/biome_js_formatter/tests/spec_test.rs b/crates/biome_js_formatter/tests/spec_test.rs index c21eff69f01c..194ea2747f4b 100644 --- a/crates/biome_js_formatter/tests/spec_test.rs +++ b/crates/biome_js_formatter/tests/spec_test.rs @@ -1,6 +1,6 @@ use biome_formatter_test::spec::{SpecSnapshot, SpecTestFile}; use biome_js_formatter::{context::JsFormatOptions, JsFormatLanguage}; -use biome_js_syntax::{JsFileSource, ModuleKind}; +use biome_js_syntax::{JsFileSource, LanguageVariant, ModuleKind}; use std::path::Path; mod language { @@ -35,6 +35,9 @@ pub fn run(spec_input_file: &str, _expected_file: &str, test_directory: &str, fi if file_type != "module" { source_type = source_type.with_module_kind(ModuleKind::Script); } + if !source_type.is_typescript() { + source_type.set_variant(LanguageVariant::Jsx); + } let options = JsFormatOptions::new(source_type); let language = language::JsTestFormatLanguage::new(source_type);