Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fakeAsync lines are not breaking when width bigger than Print Width #5201

Closed
tspmelo opened this issue Oct 8, 2018 · 1 comment
Closed
Labels
lang:javascript Issues affecting JS locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:question Questions and support requests. Please use Stack Overflow for them, not the issue tracker.

Comments

@tspmelo
Copy link

tspmelo commented Oct 8, 2018

Prettier 1.14.3
Playground link

--parser babylon

Input:

  it(
    'should run postProcess and split the breadcrumbs when navigating to hosts',
    fakeAsync(() => {
      expect(1).toEqual(1);
    })
  );

Output:

it("should run postProcess and split the breadcrumbs when navigating to hosts", fakeAsync(() => {
  expect(1).toEqual(1);
}));

Expected behavior:
1st line is longer than 80 cols so it should break.

This change was introduced in #4954.
I prefer the new fakeAsync formatting, but I think print width should have priority.

@lydell
Copy link
Member

lydell commented Oct 8, 2018

Hi! This is actually on purpose: https://prettier.io/docs/en/rationale.html#testing-functions

@lydell lydell closed this as completed Oct 8, 2018
@lydell lydell added type:question Questions and support requests. Please use Stack Overflow for them, not the issue tracker. lang:javascript Issues affecting JS labels Oct 8, 2018
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:javascript Issues affecting JS locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:question Questions and support requests. Please use Stack Overflow for them, not the issue tracker.
Projects
None yet
Development

No branches or pull requests

2 participants