NODE_V8_COVERAGE=dir


设置后,Node.js 将开始将 V8 JavaScript 代码覆盖率源映射 数据输出到作为参数提供的目录(覆盖信息以 JSON 形式写入以 coverage 为前缀的文件)。

🌐 When set, Node.js will begin outputting V8 JavaScript code coverage and Source Map data to the directory provided as an argument (coverage information is written as JSON to files with a coverage prefix).

NODE_V8_COVERAGE 会自动传递到子进程,使得对调用 child_process.spawn() 系列函数的应用进行检测更加容易。NODE_V8_COVERAGE 可以设置为空字符串,以防止传播。