监视模式
【Watch mode】
稳定性: 1 - 实验性
Node.js 测试运行器支持通过传递 --watch 标志来以观察模式运行:
【The Node.js test runner supports running in watch mode by passing the --watch flag:】
node --test --watch 在观察模式下,测试运行器会监视测试文件及其依赖的更改。当检测到更改时,测试运行器会重新运行受更改影响的测试。测试运行器会持续运行,直到进程被终止。
【In watch mode, the test runner will watch for changes to test files and their dependencies. When a change is detected, the test runner will rerun the tests affected by the change. The test runner will continue to run until the process is terminated.】