Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Apr 1, 2022
1 parent 83de36b commit ee97007
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cli/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async function format(context, input, opt) {
return {
formatted: await prettier.format(
JSON.stringify(
(await prettier.formatWithCursor(input, opt).comments) || []
(await prettier.formatWithCursor(input, opt)).comments || []
),
{ parser: "json" }
),
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/__tests__/debug-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ describe("API", () => {
"[indent(hardline), indent(literalline)]"
);

expect(formatDoc(fill(["foo", hardline, "bar", literalline, "baz"]))).toBe(
'fill(["foo", hardline, "bar", literalline, "baz"])'
);
expect(
await formatDoc(fill(["foo", hardline, "bar", literalline, "baz"]))
).toBe('fill(["foo", hardline, "bar", literalline, "baz"])');

expect(
await formatDoc(
Expand All @@ -93,8 +93,8 @@ describe("API", () => {
'label("foo", group(["1", line, "2"]))'
);

expect(await formatDoc([ifBreak("a", "b"), ifBreak("a"), ifBreak("", "b")])).toBe(
'[ifBreak("a", "b"), ifBreak("a"), ifBreak("", "b")]'
);
expect(
await formatDoc([ifBreak("a", "b"), ifBreak("a"), ifBreak("", "b")])
).toBe('[ifBreak("a", "b"), ifBreak("a"), ifBreak("", "b")]');
});
});

0 comments on commit ee97007

Please sign in to comment.