mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
@@ -1202,4 +1202,6 @@ export default {
|
||||
setDefaultAutoSelectFamilyAttemptTimeout: $zig("node_net_binding.zig", "setDefaultAutoSelectFamilyAttemptTimeout"),
|
||||
|
||||
BlockList,
|
||||
// https://github.com/nodejs/node/blob/2eff28fb7a93d3f672f80b582f664a7c701569fb/lib/net.js#L2456
|
||||
Stream: Socket,
|
||||
};
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import { ServerWebSocket, TCPSocket, Socket as _BunSocket, TCPSocketListener } from "bun";
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { connect, isIP, isIPv4, isIPv6, Socket, createConnection, Server } from "net";
|
||||
import { Stream, connect, isIP, isIPv4, isIPv6, Socket, createConnection, Server } from "net";
|
||||
import { join } from "path";
|
||||
import { bunEnv, bunExe, tmpdirSync } from "harness";
|
||||
|
||||
const socket_domain = tmpdirSync();
|
||||
|
||||
it("Stream should be aliased to Socket", () => {
|
||||
// https://github.com/nodejs/node/blob/2eff28fb7a93d3f672f80b582f664a7c701569fb/lib/net.js#L2456
|
||||
expect(Socket).toBe(Stream);
|
||||
});
|
||||
|
||||
it("should support net.isIP()", () => {
|
||||
expect(isIP("::1")).toBe(6);
|
||||
expect(isIP("foobar")).toBe(0);
|
||||
|
||||
Reference in New Issue
Block a user