Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(shared): require compatible cloudflared for Connect #13968

Closedvoltcrash(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/13968/headopened View on GitHub

Showing 2 changed files with 114 additions and 15 deletions (loading 1).

x
0 of 2 viewed, 2 left
114 additions and 15 deletionspackages/shared/src/relayClient.test.tsModified
View file
@@ -22,14 +22,14 @@
// POSIX exec bits that NTFS never reports; the win32 branch skips that check.
const windowsHost = HostProcessPlatform.defaultValue() === "win32";
​
-const hostRuntimeLayer = (env: Record<string, string> = {}) =>
+const hostRuntimeLayer = (env: Record<string, string> = {}, platform: NodeJS.Platform = "linux") =>
Layer.mergeAll(
- Layer.succeed(HostProcessPlatform, "linux"),
+ Layer.succeed(HostProcessPlatform, platform),
Layer.succeed(HostProcessArchitecture, "x64"),
ConfigProvider.layer(ConfigProvider.fromEnv({ env })),
);
​
-function makeHandle(exitCode = 0) {
+function makeHandle(exitCode = 0, output = "") {
return ChildProcessSpawner.makeHandle({
pid: ChildProcessSpawner.ProcessId(100),
exitCode: Effect.succeed(ChildProcessSpawner.ExitCode(exitCode)),
@@ -37,7 +37,7 @@
kill: () => Effect.void,
unref: Effect.succeed(Effect.void),
stdin: Sink.drain,
- stdout: Stream.empty,
+ stdout: Stream.make(new TextEncoder().encode(output)),
stderr: Stream.empty,
all: Stream.empty,
getInputFd: () => Sink.drain,
@@ -55,15 +55,17 @@