Repository: biomejs/biome (language: rust)

Issue:
📝 Body of the function is formatted with the same indent as previous line
### Environment information

```bash
CLI:
  Version:                      1.9.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.20.4"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.15.8"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              true
  Organize imports disabled:    true
  VCS disabled:                 false

Formatter:
  Format with errors:           true
  Indent style:                 Tab
  Indent width:                 2
  Line ending:                  Lf
  Line width:                   95
  Attribute position:           Auto
  Bracket spacing:              BracketSpacing(true)
  Ignore:                       ["**/dist/**", "**/lib/**"]
  Include:                      []

JavaScript Formatter:
  Enabled:                      false
  JSX quote style:              Double
  Quote properties:             Preserve
  Trailing commas:              All
  Semicolons:                   Always
  Arrow parentheses:            Always
  Bracket spacing:              BracketSpacing(true)
  Bracket same line:            false
  Quote style:                  Double
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Attribute position:           unset

JSON Formatter:
  Enabled:                      false
  Indent style:                 Tab
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Trailing Commas:              unset

CSS Formatter:
  Enabled:                      true
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Quote style:                  Double

GraphQL Formatter:
  Enabled:                      false
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Bracket spacing:              unset
  Quote style:                  unset

Workspace:
  Open Documents:               0
```


### Configuration

```JSON
{
	"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
	"vcs": {
		"enabled": true,
		"clientKind": "git",
		"root": ".",
		"useIgnoreFile": true,
		"defaultBranch": "main"
	},
	"formatter": {
		"enabled": true,
		"ignore": ["**/dist/**", "**/lib/**"],
		"formatWithErrors": true,
		"indentStyle": "tab",
		"lineWidth": 95,
		"lineEnding": "lf"
	},
	"javascript": {
		"formatter": {
			"arrowParentheses": "always",
			"jsxQuoteStyle": "double",
			"semicolons": "always",
			"trailingCommas": "all",
			"quoteProperties": "preserve",
			"quoteStyle": "double",
			"bracketSpacing": true
		}
	},
	"json": {
		"formatter": {
			"indentStyle": "tab"
		}
	}
}
```


### Playground link

https://biomejs.dev/playground/?quoteProperties=preserve&trailingCommas=none&code=ZABlAHMAYwByAGkAYgBlACgAIgB0AGUAcwB0ACIALAAgACgAKQAgAD0APgAgAHsACgBpAHQAKAAiAEMAbABpAGUAbgB0ACAAMwAgAHMAaABvAHUAbABkACAAdwBhAGkAdAAgAGYAbwByACAAYwBsAGkAZQBuAHQAIAAyACgAdwBoAGkAYwBoACAAZwBvAHQAIABkAGkAcwBjAG8AbgBuAGUAYwB0AGUAZAAgAHcAaQB0AGgAbwB1AHQAIABzAGUAbgBkAGkAbgBnACAAYQBuAHkAIABvAHAAcwApACAAdABvACAAbABlAGEAdgBlACAAIgAgACsACgAJAAkAIgB3AGgAZQBuACAAYwBsAGkAZQBuAHQAIAAyACAAYQBsAHIAZQBhAGQAeQAgAHcAYQBpAHQAZQBkACAAbwBuACAAYwBsAGkAZQBuAHQAIAAxACIALAAgAGEAcwB5AG4AYwAgACgAKQAgAD0APgAgAHsACgAgACAAYwBvAG4AcwB0ACAAYgBsAG8AYwBrAEIAZQBnAGkAbgAgAD0AIAAwADsACgAgACAALwAvACAALgAuAC4AIABtAG8AcgBlACAAYwBvAGQAZQAgAC4ALgAuAAoACQB9ACkAOwAKAH0AKQA7AA%3D%3D

### Code of Conduct

- [X] I agree to follow Biome's Code of Conduct


Discussion / hints:
I’d like to work on this issue.

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 88a734c3bf8a..e635f66704ba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,6 +41,8 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b
 - `biome migrate eslint` now correctly handles ESLint configuration with `null` values in file lists ([#4740](https://github.com/biomejs/biome/issues/4740)).
   Contributed by @Conaclos
 
+- Fix [#4202](https://github.com/biomejs/biome/issues/4202), where the formatting of the test function was different from prettier. Contributed by @mdm317
+
 ### Configuration
 
 ### Editors
diff --git a/crates/biome_js_formatter/src/js/expressions/call_arguments.rs b/crates/biome_js_formatter/src/js/expressions/call_arguments.rs
index 7126ccb998be..93cab58c8244 100644
--- a/crates/biome_js_formatter/src/js/expressions/call_arguments.rs
+++ b/crates/biome_js_formatter/src/js/expressions/call_arguments.rs
@@ -14,8 +14,8 @@ use biome_js_syntax::{
     AnyJsCallArgument, AnyJsExpression, AnyJsFunctionBody, AnyJsLiteralExpression, AnyJsStatement,
     AnyTsReturnType, AnyTsType, JsBinaryExpressionFields, JsCallArgumentList, JsCallArguments,
     JsCallArgumentsFields, JsCallExpression, JsExpressionStatement, JsFunctionExpression,
-    JsImportCallExpression, JsLanguage, JsLogicalExpressionFields, TsAsExpressionFields,
-    TsSatisfiesExpressionFields,
+    JsImportCallExpression, JsLanguage, JsLogicalExpressionFields, JsSyntaxKind,
+    TsAsExpressionFields, TsSatisfiesExpressionFields,
 };
 use biome_rowan::{AstSeparatedElement, AstSeparatedList, SyntaxResult};
 
@@ -53,10 +53,23 @@ impl FormatNodeRule<JsCallArguments> for FormatJsCallArguments {
                     )
                 });
 
+        let is_first_arg_string_literal_or_template = if args.len() != 2 {
+            true
+        } else {
+            matches!(
+            args.iter().next(),
+            Some(Ok(AnyJsCallArgument::AnyJsExpression(first)))
+                if matches!(
+                    first.syntax().kind(),
+                    JsSyntaxKind::JS_STRING_LITERAL_EXPRESSION | JsSyntaxKind::JS_TEMPLATE_EXPRESSION
+                )
+            )
+        };
+
         if is_commonjs_or_amd_call?
             || is_multiline_template_only_args(node)
             || is_react_hook_with_deps_array(node, f.comments())
-            || is_test_call?
+            || (is_test_call? && is_first_arg_string_literal_or_template)
         {
             return write!(
                 f,


Test patch:
diff --git a/crates/biome_js_formatter/tests/specs/js/module/declarations/test_declaration.js b/crates/biome_js_formatter/tests/specs/js/module/declarations/test_declaration.js
new file mode 100644
index 000000000000..74a95e9ab34e
--- /dev/null
+++ b/crates/biome_js_formatter/tests/specs/js/module/declarations/test_declaration.js
@@ -0,0 +1,26 @@
+describe("test", () => {
+  it(``, async () => {
+  });
+});
+  
+describe("test", () => {
+  it("wrooooooooooooooooooooooooooooooooooooooooooooong string" +
+    "second string", async () => {
+  });
+});
+
+it(`${foo + bar}
+  handles
+  some
+    newlines does something really long and complicated 
+    so I have to write a very long name for the test`, () => {
+});
+
+describe(`${foo + bar}`, 
+  () => {}
+);
+
+describe(`${foo + bar} wroooooooooooooooooooooooooooooong string`, 
+  () => {}
+);
+
diff --git a/crates/biome_js_formatter/tests/specs/js/module/declarations/test_declaration.js.snap b/crates/biome_js_formatter/tests/specs/js/module/declarations/test_declaration.js.snap
new file mode 100644
index 000000000000..1b0902dde466
--- /dev/null
+++ b/crates/biome_js_formatter/tests/specs/js/module/declarations/test_declaration.js.snap
@@ -0,0 +1,82 @@
+---
+source: crates/biome_formatter_test/src/snapshot_builder.rs
+info: js/module/declarations/test_declaration.js
+---
+# Input
+
+```js
+describe("test", () => {
+  it(``, async () => {
+  });
+});
+  
+describe("test", () => {
+  it("wrooooooooooooooooooooooooooooooooooooooooooooong string" +
+    "second string", async () => {
+  });
+});
+
+it(`${foo + bar}
+  handles
+  some
+    newlines does something really long and complicated 
+    so I have to write a very long name for the test`, () => {
+});
+
+describe(`${foo + bar}`, 
+  () => {}
+);
+
+describe(`${foo + bar} wroooooooooooooooooooooooooooooong string`, 
+  () => {}
+);
+
+
+```
+
+
+=============================
+
+# Outputs
+
+## Output 1
+
+-----
+Indent style: Tab
+Indent width: 2
+Line ending: LF
+Line width: 80
+Quote style: Double Quotes
+JSX quote style: Double Quotes
+Quote properties: As needed
+Trailing commas: All
+Semicolons: Always
+Arrow parentheses: Always
+Bracket spacing: true
+Bracket same line: false
+Attribute Position: Auto
+-----
+
+```js
+describe("test", () => {
+	it(``, async () => {});
+});
+
+describe("test", () => {
+	it(
+		"wrooooooooooooooooooooooooooooooooooooooooooooong string" +
+			"second string",
+		async () => {},
+	);
+});
+
+it(`${foo + bar}
+  handles
+  some
+    newlines does something really long and complicated 
+    so I have to write a very long name for the test`, () => {});
+
+describe(`${foo + bar}`, () => {});
+
+describe(`${foo + bar} wroooooooooooooooooooooooooooooong string`, () => {});
+```