Skip to content

Commit 049400d

Browse files
authored
Merge pull request #45 from aptos-labs/config_number_of_mocha_jobs
Specify the number of jobs to run in parallel
2 parents d91cd8f + f335ff2 commit 049400d

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

workspace/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workspace/src/internal/cli.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ program
7676
"-g, --grep <file>",
7777
"Only run tests matching the given string or regexp"
7878
)
79+
.option(
80+
"-j, --jobs <number>",
81+
"Specify the number of jobs to run in parallel"
82+
)
7983
.action(async (options) => {
8084
await test(options);
8185
});

workspace/src/tasks/test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { isTSProject } from "../internal/utils/typescript-support";
1212
export type TestOptionsArguments = {
1313
timeout: string;
1414
grep: string;
15+
jobs: number;
1516
};
1617

1718
export const test = async (options: TestOptionsArguments) => {
@@ -39,6 +40,10 @@ export const test = async (options: TestOptionsArguments) => {
3940
mochaConfig.grep = options.grep;
4041
}
4142

43+
if (options.jobs !== undefined) {
44+
mochaConfig.jobs = options.jobs;
45+
}
46+
4247
const mocha = new Mocha(mochaConfig);
4348

4449
// add all user's porject test files to mocha

0 commit comments

Comments
 (0)