Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/_tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ describe("tunnel", () => {
it("should create a tunnel", async () => {
const { url, connections, child, stop } = tunnel();
expect(await url).toMatch(/https?:\/\/[^\s]+/);
const conns = await Promise.all(connections);
expect(conns.length).toBe(4);
await connections[0]; // quick tunnel only has one connection
expect(child).toBeInstanceOf(ChildProcess);
stop();
});
Expand Down
2 changes: 1 addition & 1 deletion src/tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function tunnel(options: Record<string, string | number | null> = {}): {
const connection_resolvers: ((value: Connection | PromiseLike<Connection>) => void)[] = [];
const connection_rejectors: ((reason: unknown) => void)[] = [];
const connections: Promise<Connection>[] = [];
for (let i = 0; i < 4; i++) {
for (let i = 0; i < 1; i++) {
connections.push(
new Promise<Connection>(
(...pair) => ([connection_resolvers[i], connection_rejectors[i]] = pair),
Expand Down