--test-shard


要执行的测试套件分片,格式为 <index>/<total>,其中

【Test suite shard to execute in a format of <index>/<total>, where】

  • index 是一个正整数,表示分割部分的索引。
  • total 是一个正整数,表示分割部分的总和。

此命令将把所有测试文件分成 total 等份,并且只运行位于第 index 部分的测试文件。

【This command will divide all tests files into total equal parts, and will run only those that happen to be in an index part.】

例如,要将测试套件分为三个部分,请使用:

【For example, to split your tests suite into three parts, use this:】

node --test --test-shard=1/3
node --test --test-shard=2/3
node --test --test-shard=3/3