Add support for timeouts passed as integers to test functions#5085
Add support for timeouts passed as integers to test functions#5085j-f1 merged 2 commits intoprettier:masterfrom
Conversation
|
Why was this added? What's the reasoning? There's nothing meaningful in #5051. I much prefer the standard, consistent formatting to the new, custom formatting. |
|
@niieani to keep consistent with how we format other tests Before it('name of a test', () => {
// code
});
it(
'name of another test',
() => {
// code
},
200
);Now it('name of a test', () => {
// code
});
it('name of another test', () => {
// code
}, 200); |
|
Why do we format tests using a separate logic altogether? I see this odd formatting logic only kicks in for |
|
@niieani IMO that conditional is bad practice — your tests should always be static. Both sides of the ternary will format properly: Prettier pr-5366 --parser babylonOutput: it("name of another test", () => {
// code
}, 200);
it.skip("name of another test", () => {
// code
}, 200);Also, people will typically have many tests, so it’s more important IMO to keep the test code unindented than to have the |
docs/directory)Fixes #5061