Skip to content

Commit

Permalink
feedback and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny committed Sep 10, 2021
1 parent 72c26b6 commit c7ebc25
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js
Expand Up @@ -80,15 +80,16 @@ function getDefinitionsToRun(allTestDefns, requestedIds, {invertMatch}) {
* Parses the cli `shardArg` flag into `shardNumber/shardTotal`. Splits
* `testDefns` into `shardTotal` shards and returns the `shardNumber`th shard.
* Shards will differ in size by at most 1.
* Shard params must be 1shardNumbershardTotal.
* Shard params must be 1shardNumbershardTotal.
* @param {Array<Smokehouse.TestDfn>} testDefns
* @param {string=} shardArg
* @return {Array<Smokehouse.TestDfn>}
*/
function getShardedDefinitions(testDefns, shardArg) {
if (!shardArg) return testDefns;

const errorMessage = `'shard' must be of the form 'n/d' and n and d must be positive integers with 1≤n≤d. Got '${shardArg}'`;
// eslint-disable-next-line max-len
const errorMessage = `'shard' must be of the form 'n/d' and n and d must be positive integers with 1 ≤ n ≤ d. Got '${shardArg}'`;
const match = /^(?<shardNumber>\d+)\/(?<shardTotal>\d+)$/.exec(shardArg);
assert(match && match.groups, errorMessage);
const shardNumber = Number(match.groups.shardNumber);
Expand Down Expand Up @@ -202,8 +203,9 @@ async function begin() {
},
'shard': {
type: 'string',
describe: 'A argument of the form "n/d", which divides the selected tests into d groups and runs the nth group. n and d must be positive integers with 1≤n≤d.',
}
// eslint-disable-next-line max-len
describe: 'A argument of the form "n/d", which divides the selected tests into d groups and runs the nth group. n and d must be positive integers with 1 ≤ n ≤ d.',
},
})
.wrap(yargs.terminalWidth())
.argv;
Expand Down

0 comments on commit c7ebc25

Please sign in to comment.