--test-shard
新增于: v20.5.0, v18.19.0
以 <index>/<total> 格式执行的测试套件分片,其中
\Test suite shard to execute in a format of <index>/<total>, where
-
index是一个正整数,表示被分割部分的索引。\
indexis a positive integer, index of divided parts. -
total是一个正整数,表示被分割部分的总和。\
totalis a positive integer, total of divided part.
此命令会将所有测试文件分成相等的 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