close()

停止当前 Node.js 进程中的请求拦截。

调用签名

¥Call signature

server.close() 函数不接受任何参数,也不返回任何内容。这是一个同步函数,因为 Node.js 中的请求拦截是通过原生类扩展执行的,这是一个同步过程。

¥The server.close() function does not accept any argument and doesn’t return anything. It is a synchronous function since request interception in Node.js is performed via native class extensions, which is a synchronous process.

server.close()

此方法旨在在不再需要 API 模拟功能时调用,例如当测试运行完成时。

¥This method is designed to be called when the API mocking capabilities are no longer needed, for example when the test run is finished.

相关材料

¥Related materials