Skip to content

Commit 9562278

Browse files
committed
test(cli): cover unsupported desktop app platforms
1 parent 750530a commit 9562278

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎apps/server/src/cli/app.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,25 @@ describe("t3 app", () => {
149149
),
150150
);
151151

152+
it.effect("rejects unsupported platforms without creating state", () =>
153+
withTempDirectory("t3-app-platform-test-", (root) =>
154+
Effect.gen(function* () {
155+
const baseDir = NodePath.join(root, "missing-t3-home");
156+
const error = yield* runCli(["app", "--base-dir", baseDir]).pipe(
157+
Effect.provideService(HostProcessPlatform, "freebsd"),
158+
Effect.flip,
159+
);
160+
161+
expect(error).toMatchObject({
162+
_tag: "DesktopAppPlatformUnsupportedError",
163+
platform: "freebsd",
164+
message: "`t3 app` is not supported on freebsd.",
165+
});
166+
expect(yield* pathExists(baseDir)).toBe(false);
167+
}),
168+
),
169+
);
170+
152171
it.effect("does not create state when only a server or no desktop app is running", () =>
153172
withTempDirectory("t3-app-missing-test-", (root) =>
154173
Effect.gen(function* () {

0 commit comments

Comments
 (0)