Skip to main content
Version: 29.7

环境变量

Jest 设置以下环境变量:

¥Jest sets the following environment variables:

NODE_ENV

如果尚未设置为其他值,则设置为 'test'

¥Set to 'test' if it's not already set to something else.

JEST_WORKER_ID

每个工作进程都分配有一个唯一的 ID(基于索引,以 1 开头)。当 runInBand 设置为 true 时,所有测试都将其设置为 1

¥Each worker process is assigned a unique id (index-based that starts with 1). This is set to 1 for all tests when runInBand is set to true.