diff --git a/tests/integration/__tests__/debug-api.js b/tests/integration/__tests__/debug-api.js index af38a2937..d2145a7f8 100644 --- a/tests/integration/__tests__/debug-api.js +++ b/tests/integration/__tests__/debug-api.js @@ -72,18 +72,6 @@ describe("API", () => { await formatDoc(fill(["foo", hardline, "bar", literalline, "baz"])), ).toBe('fill(["foo", hardline, "bar", literalline, "baz"])'); - /* - This is not really `cleanDoc` from `src/document/utils.js` - But if we pass array to it, it will flat array - */ - const cleanDoc = (parts) => parts.flat(); - expect( - await formatDoc( - // The argument of fill must not be passed to cleanDoc because it's not a doc - fill(cleanDoc(["foo", literalline, "bar"])), // invalid fill - ), - ).toBe('fill(["foo", literallineWithoutBreakParent, breakParent, "bar"])'); - expect( await formatDoc(indentIfBreak(group(["1", line, "2"]), { groupId: "Q" })), ).toBe('indentIfBreak(group(["1", line, "2"]), { groupId: "Q" })'); diff --git a/tests/integration/__tests__/doc-builders.js b/tests/integration/__tests__/doc-builders.js index b554f90ad..2d42d26c8 100644 --- a/tests/integration/__tests__/doc-builders.js +++ b/tests/integration/__tests__/doc-builders.js @@ -5,6 +5,7 @@ const { literalline, group, fill, + line, lineSuffix, breakParent, ifBreak, @@ -33,7 +34,7 @@ describe("doc builders", () => { expandedStates: undefined, }, ], - ["fill", fill(["1", "2"]), { type: "fill", parts: ["1", "2"] }], + ["fill", fill(["1", line, "2"]), { type: "fill", parts: ["1", line, "2"] }], [ "line-suffix", lineSuffix(["1"]), diff --git a/tests/integration/__tests__/doc-utils-clean-doc.js b/tests/integration/__tests__/doc-utils-clean-doc.js index 9372b6b12..699832780 100644 --- a/tests/integration/__tests__/doc-utils-clean-doc.js +++ b/tests/integration/__tests__/doc-utils-clean-doc.js @@ -4,6 +4,7 @@ import { group, ifBreak, indent, + line, lineSuffix, } from "../../../src/document/builders.js"; import { cleanDoc } from "../../../src/document/utils.js"; @@ -12,8 +13,8 @@ describe("cleanDoc", () => { test.each([ [ "fill", - [fill(["", ""]), fill([]), fill(["1"]), fill(["2", "3"])], - [fill(["1"]), fill(["2", "3"])], + [fill([""]), fill([]), fill(["1"]), fill(["2", line, "3"])], + [fill(["1"]), fill(["2", line, "3"])], ], ["nested group", group(group("_")), group("_")], [