-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
bugSomething isn't workingSomething isn't workingnice-reproAn unusually helpful reproduction is providedAn unusually helpful reproduction is providednode:http
Description
What version of Bun is running?
1.2.12+32a47ae45
What platform is your computer?
Darwin 24.3.0 arm64 arm
What steps can reproduce the bug?
$ bun check.js
const request = require("supertest");
const express = require("express");
const app = express();
app.get("/user", function (req, res) {
res.status(200).json({ name: "john" });
});
const server = app.listen(); // Store server instance
request(app)
.get("/user")
.expect("Content-Type", /json/)
.expect("Content-Length", "15")
.expect(200)
.end(function (err, res) {
if (err) throw err;
server.close(); // Close the server when done
});
console.log("done");What is the expected behavior?
The express server should be closed when reaching the end of the file, which works correctly in Node.js
What do you see instead?
The script hangs, not finishing properly.
process.exit(); is harder and kills the script for sure, but it should work by closing the server instance.
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingnice-reproAn unusually helpful reproduction is providedAn unusually helpful reproduction is providednode:http