diff --git a/crates/oxc_formatter/src/utils/call_expression.rs b/crates/oxc_formatter/src/utils/call_expression.rs index 7ecc621ef40fb..91f1358287686 100644 --- a/crates/oxc_formatter/src/utils/call_expression.rs +++ b/crates/oxc_formatter/src/utils/call_expression.rs @@ -151,51 +151,51 @@ pub fn callee_name_iterator<'b>(expr: &'b Expression<'_>) -> Option pub fn contains_a_test_pattern(expr: &Expression<'_>) -> bool { let Some(mut names) = callee_name_iterator(expr) else { return false }; match names.next() { - Some("it" | "describe") => match names.next() { + Some("it") => match names.next() { + None => true, + Some( + "only" | "skip" | "skipIf" | "runIf" | "concurrent" | "sequential" | "todo" + | "fails", + ) => names.next().is_none(), + _ => false, + }, + Some("describe") => match names.next() { None => true, - Some("only" | "skip") => names.next().is_none(), + Some( + "only" | "skip" | "skipIf" | "runIf" | "concurrent" | "sequential" | "shuffle" + | "todo", + ) => names.next().is_none(), _ => false, }, Some("Deno") => matches!(names.next(), Some("test")) && names.next().is_none(), Some("test") => match names.next() { None => true, - Some("only" | "skip" | "step" | "fixme") => names.next().is_none(), + Some( + "only" | "skip" | "skipIf" | "runIf" | "concurrent" | "sequential" | "todo" + | "fails" | "extend" | "step" | "fixme", + ) => names.next().is_none(), Some("describe") => match names.next() { None => true, Some("only" | "skip" | "fixme") => names.next().is_none(), @@ -208,6 +208,11 @@ pub fn contains_a_test_pattern(expr: &Expression<'_>) -> bool { }, _ => false, }, + Some("bench") => match names.next() { + None => true, + Some("only" | "skip" | "todo") => names.next().is_none(), + _ => false, + }, Some("skip" | "xit" | "xdescribe" | "xtest" | "fit" | "fdescribe" | "ftest") => true, _ => false, }