Skip to content

Commit

Permalink
test: block host on all interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Sep 6, 2023
1 parent cf4317c commit 5a95184
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createServer, Server } from "node:net";

export function blockPort(port: number, host = "0.0.0.0"): Promise<Server> {
export function blockPort(port: number, host?: string): Promise<Server> {
return new Promise((resolve) => {
const blocker = createServer();
blocker.listen(port, host, () => {
Expand All @@ -11,7 +11,7 @@ export function blockPort(port: number, host = "0.0.0.0"): Promise<Server> {

export async function blockPorts(
ports: number[],
host = "0.0.0.0",
host?: string,
): Promise<Server[]> {
const portBlockers: Server[] = [];

Expand Down

0 comments on commit 5a95184

Please sign in to comment.