jest test emitting events for eventemitter objects (express)
问题 trying to get an inspiration from jest test emitting events for eventemitter objects (http) didn't solve my pain with express. assume the following nodejs code // server.js const express = require("express"); const app = express(); const server = app.listen(8080,'127.0.0.1') .on("error", err => { // ... }); module.exports = server; how to write a test using jest to emit the http "error" event (to cover the error event handler)? i tried: // server.test.js it("should handle error", () => { jest