test: use shorthand properties in tests#18105
test: use shorthand properties in tests#18105tniessen wants to merge 12 commits intonodejs:masterfrom
Conversation
why not |
@devsnek Because that change might be controversial. I assumed changing the notation when all properties can be converted won't be, so I decided to go with that for now. If we get consensus about other cases, I will be happy to change those too. |
| [{ port: port }, { protocol: 'http:' }], | ||
| [{ port: port, hostname: '127.0.0.1' }, { protocol: 'http:' }] | ||
| [{ port }, { protocol: 'http:' }], | ||
| [{ port, hostname: '127.0.0.1' }, { protocol: 'http:' }] |
There was a problem hiding this comment.
This is an exception for the sake of consistency with the line above. Feel free to request changes here (and anywhere else).
|
|
||
| const w = new Writable({ highWaterMark: highWaterMark * 2, | ||
| objectMode: objectMode }); | ||
| objectMode }); |
There was a problem hiding this comment.
This is the second exception to the described rule, again, feel free to request changes here.
|
Maybe we can add the "object-shorthand" rule with "consistent as needed" option into |
|
CI seems to be a bit unreliable, trying again: https://ci.nodejs.org/job/node-test-pull-request/12579/ |
|
Landed in db9c556. |
PR-URL: #18105 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #18105 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #18105 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This updates the tests to use shorthand property declarations when all properties can be converted to the shortened notation (with two exceptions).
{ a: a, b: b, ... }becomes{ a, b }, but{ a: a, b: c, ... }remains{ a: a, b: c, ... }.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test