Skip to content

Commit 07b1119

Browse files
authored
Merge pull request #5 from riderx/patch-1
Adapt to the new version with one 1 conn
2 parents b810ee7 + 750e925 commit 07b1119

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/_tests/index.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ describe("tunnel", () => {
2222
it("should create a tunnel", async () => {
2323
const { url, connections, child, stop } = tunnel();
2424
expect(await url).toMatch(/https?:\/\/[^\s]+/);
25-
const conns = await Promise.all(connections);
26-
expect(conns.length).toBe(4);
25+
await connections[0]; // quick tunnel only has one connection
2726
expect(child).toBeInstanceOf(ChildProcess);
2827
stop();
2928
});

src/tunnel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function tunnel(options: Record<string, string | number | null> = {}): {
4848
const connection_resolvers: ((value: Connection | PromiseLike<Connection>) => void)[] = [];
4949
const connection_rejectors: ((reason: unknown) => void)[] = [];
5050
const connections: Promise<Connection>[] = [];
51-
for (let i = 0; i < 4; i++) {
51+
for (let i = 0; i < 1; i++) {
5252
connections.push(
5353
new Promise<Connection>(
5454
(...pair) => ([connection_resolvers[i], connection_rejectors[i]] = pair),

0 commit comments

Comments
 (0)