快递存根为测试目的创建快速存根中间件。与proxyquire得很好。安装$ npm install express-stub用法const stub = require ( 'express-stub' ) const express = require ( 'express' ) const app = express ( ) app . use ( stub ( ) ) app . listen ( )也可以看看执照