子进程选项继承


【Child process option inheritance】

在以进程隔离模式(默认模式)运行测试时,生成的子进程会继承父进程的 Node.js 选项,包括 配置文件 中指定的选项。然而,为了确保测试运行器的正常功能,某些标志会被过滤掉:

【When running tests in process isolation mode (the default), spawned child processes inherit Node.js options from the parent process, including those specified in configuration files. However, certain flags are filtered out to enable proper test runner functionality:】

  • --test - 防止递归测试执行
  • --experimental-test-coverage - 由测试运行器管理
  • --watch - 监听模式由父级处理
  • --experimental-default-config-file - 配置文件的加载由父进程处理
  • --test-reporter - 报告由父进程管理
  • --test-reporter-destination - 输出目标由父进程控制
  • --experimental-config-file - 配置文件路径由父级管理

来自命令行参数、环境变量和配置文件的所有其他 Node.js 选项都会被子进程继承。

【All other Node.js options from command line arguments, environment variables, and configuration files are inherited by the child processes.】