diff --git a/crates/oxc_formatter/tests/ir_transform/sort_imports.rs b/crates/oxc_formatter/tests/ir_transform/sort_imports.rs index e77e50e7a0014..5c60e63af3563 100644 --- a/crates/oxc_formatter/tests/ir_transform/sort_imports.rs +++ b/crates/oxc_formatter/tests/ir_transform/sort_imports.rs @@ -375,6 +375,33 @@ import type { T1, T2 } from "t"; import type { V } from "v"; const X = 1; import type { T1, T2 } from "t"; +"#, + ); + // Still works with multiple import groups + assert_format( + r#" +import b from "b"; +import a from "a"; +const X = 1; +import d from "d"; +import c from "c"; +export const Y = 2; +import f from "f"; +import e from "e"; +"#, + &FormatOptions { + experimental_sort_imports: Some(SortImports::default()), + ..Default::default() + }, + r#" +import a from "a"; +import b from "b"; +const X = 1; +import c from "c"; +import d from "d"; +export const Y = 2; +import e from "e"; +import f from "f"; "#, ); }