dangreenisrael / eslint-plugin-jest-formatting

ESLint rules for formatting test suites written for jest.
MIT License
156 stars 13 forks source link

[BUG] `padding-around-expect-groups` wants space around `expect`s which are `await`ed #98

Closed tmercswims closed 3 years ago

tmercswims commented 3 years ago

Describe the bug If I have two expects right next to each other, and one of them is awaited, the padding-around-expect-groups rule wants there to be a blank line between them.

To Reproduce Example code:

await expect(subject.asyncThingWhichThrows()).rejects.toThrow(SomeError);
expect(subject.thingWhichWorks()).toBe('some value');

Expected behavior awaited expects should be allowed to be right next to regular ones.

Screenshots Real example: image

Desktop (please complete the following information):

dangreenisrael commented 3 years ago

Nice catch @tmercswims.

Any interest in adding a test case and opening a PR to fix it?

dangreenisrael commented 3 years ago

Thanks so mych @tmercswims. I've just cut a 3.0.0 release with your improvements in it.

tmercswims commented 3 years ago

Of course, I'm happy that I could contribute! 🙂

dangreenisrael commented 3 years ago

Now we've got our hooks in you 😉