Skip to content

Commit f1935ea

Browse files
chore(cli): fix tests
1 parent fb55702 commit f1935ea

File tree

7 files changed

+33
-31
lines changed

7 files changed

+33
-31
lines changed

apps/cli/test/auth.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ describe("Authentication Configurations", () => {
9898
expectError(result, "Authentication requires a database");
9999
});
100100

101-
it("should fail with better-auth + convex backend", async () => {
101+
it("should work with better-auth + convex backend (tanstack-router)", async () => {
102102
const result = await runTRPCTest({
103-
projectName: "better-auth-convex-fail",
103+
projectName: "better-auth-convex-success",
104104
auth: "better-auth",
105105
backend: "convex",
106106
runtime: "none",
@@ -113,10 +113,9 @@ describe("Authentication Configurations", () => {
113113
dbSetup: "none",
114114
webDeploy: "none",
115115
serverDeploy: "none",
116-
expectError: true,
117116
});
118117

119-
expectError(result, "Better-Auth is not compatible with Convex backend");
118+
expectSuccess(result);
120119
});
121120

122121
it("should work with better-auth + all compatible frontends", async () => {

apps/cli/test/backend-runtime.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ describe("Backend and Runtime Combinations", () => {
215215
expectSuccess(result);
216216
});
217217

218-
it("should fail convex with better-auth", async () => {
218+
it("should work convex with better-auth (tanstack-router)", async () => {
219219
const result = await runTRPCTest({
220-
projectName: "convex-better-auth",
220+
projectName: "convex-better-auth-success",
221221
backend: "convex",
222222
runtime: "none",
223223
database: "none",
@@ -230,10 +230,9 @@ describe("Backend and Runtime Combinations", () => {
230230
dbSetup: "none",
231231
webDeploy: "none",
232232
serverDeploy: "none",
233-
expectError: true,
234233
});
235234

236-
expectError(result, "Better-Auth is not compatible with Convex backend");
235+
expectSuccess(result);
237236
});
238237

239238
it("should fail convex with database", async () => {

apps/cli/test/basic-configurations.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe("Basic Configurations", () => {
9898

9999
expectSuccess(result);
100100
expect(result.result?.projectConfig.install).toBe(true);
101-
});
101+
}, 300000); // 5 minute timeout for install test
102102

103103
it("should work with install disabled", async () => {
104104
const result = await runTRPCTest({
@@ -145,7 +145,7 @@ describe("Basic Configurations", () => {
145145
expectError: true,
146146
});
147147

148-
expectError(result, "invalid characters");
148+
expectError(result, "Input validation failed");
149149
});
150150

151151
it("should fail when combining --yes with configuration flags", async () => {

apps/cli/test/test-utils.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { rm } from "node:fs/promises";
22
import { join } from "node:path";
3+
import { createRouterClient } from "@orpc/server";
34
import { ensureDir } from "fs-extra";
4-
import { trpcServer } from "trpc-cli";
55
import { expect } from "vitest";
66
import { router } from "../src/index";
77
import type { CreateInput, InitResult } from "../src/types";
@@ -16,13 +16,13 @@ import {
1616
FrontendSchema,
1717
ORMSchema,
1818
PackageManagerSchema,
19+
PaymentsSchema,
1920
RuntimeSchema,
2021
ServerDeploySchema,
2122
WebDeploySchema,
2223
} from "../src/types";
2324

24-
// Create tRPC caller for direct function calls instead of subprocess
25-
const t = trpcServer.initTRPC.create();
25+
// Create oRPC caller for direct function calls instead of subprocess
2626
const defaultContext = {};
2727

2828
/**
@@ -65,7 +65,7 @@ export async function runTRPCTest(config: TestConfig): Promise<TestResult> {
6565
// Set programmatic mode to ensure errors are thrown instead of process.exit
6666
process.env.BTS_PROGRAMMATIC = "1";
6767

68-
const caller = t.createCallerFactory(router)(defaultContext);
68+
const caller = createRouterClient(router, { context: defaultContext });
6969
const projectName = config.projectName || "default-app";
7070
const projectPath = join(smokeDir, projectName);
7171

@@ -80,6 +80,7 @@ export async function runTRPCTest(config: TestConfig): Promise<TestResult> {
8080
"addons",
8181
"examples",
8282
"auth",
83+
"payments",
8384
"dbSetup",
8485
"api",
8586
"webDeploy",
@@ -105,6 +106,7 @@ export async function runTRPCTest(config: TestConfig): Promise<TestResult> {
105106
database: "sqlite" as Database,
106107
orm: "drizzle" as ORM,
107108
auth: "none" as Auth,
109+
payments: "none" as Payments,
108110
addons: ["none"] as Addons[],
109111
examples: ["none"] as Examples[],
110112
dbSetup: "none" as DatabaseSetup,
@@ -117,7 +119,7 @@ export async function runTRPCTest(config: TestConfig): Promise<TestResult> {
117119
renderTitle: false,
118120
install: config.install ?? false,
119121
git: config.git ?? true,
120-
packageManager: config.packageManager ?? "bun",
122+
packageManager: config.packageManager ?? "pnpm",
121123
directoryConflict: "overwrite",
122124
verbose: true, // Need verbose to get the result
123125
disableAnalytics: true,
@@ -202,6 +204,7 @@ export type Frontend = (typeof FrontendSchema)["options"][number];
202204
export type Addons = (typeof AddonsSchema)["options"][number];
203205
export type Examples = (typeof ExamplesSchema)["options"][number];
204206
export type Auth = (typeof AuthSchema)["options"][number];
207+
export type Payments = (typeof PaymentsSchema)["options"][number];
205208
export type API = (typeof APISchema)["options"][number];
206209
export type WebDeploy = (typeof WebDeploySchema)["options"][number];
207210
export type ServerDeploy = (typeof ServerDeploySchema)["options"][number];
@@ -217,6 +220,7 @@ export const FRONTENDS = extractEnumValues(FrontendSchema);
217220
export const ADDONS = extractEnumValues(AddonsSchema);
218221
export const EXAMPLES = extractEnumValues(ExamplesSchema);
219222
export const AUTH_PROVIDERS = extractEnumValues(AuthSchema);
223+
export const PAYMENTS_PROVIDERS = extractEnumValues(PaymentsSchema);
220224
export const API_TYPES = extractEnumValues(APISchema);
221225
export const WEB_DEPLOYS = extractEnumValues(WebDeploySchema);
222226
export const SERVER_DEPLOYS = extractEnumValues(ServerDeploySchema);

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
33
"vcs": {
44
"enabled": false,
55
"clientKind": "git",

bun.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"": {
55
"name": "better-t-stack",
66
"devDependencies": {
7-
"@biomejs/biome": "2.2.0",
8-
"@types/bun": "latest",
7+
"@biomejs/biome": "2.2.4",
8+
"@types/bun": "^1.2.22",
99
"changelogithub": "^13.16.0",
1010
"husky": "^9.1.7",
11-
"lint-staged": "^16.1.5",
11+
"lint-staged": "^16.2.1",
1212
"turbo": "^2.5.8",
1313
"typescript": "5.9.2",
1414
},
@@ -259,23 +259,23 @@
259259

260260
"@better-t-stack/backend": ["@better-t-stack/backend@workspace:packages/backend"],
261261

262-
"@biomejs/biome": ["@biomejs/[email protected].0", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.2.0", "@biomejs/cli-darwin-x64": "2.2.0", "@biomejs/cli-linux-arm64": "2.2.0", "@biomejs/cli-linux-arm64-musl": "2.2.0", "@biomejs/cli-linux-x64": "2.2.0", "@biomejs/cli-linux-x64-musl": "2.2.0", "@biomejs/cli-win32-arm64": "2.2.0", "@biomejs/cli-win32-x64": "2.2.0" }, "bin": { "biome": "bin/biome" } }, "sha512-3On3RSYLsX+n9KnoSgfoYlckYBoU6VRM22cw1gB4Y0OuUVSYd/O/2saOJMrA4HFfA1Ff0eacOvMN1yAAvHtzIw=="],
262+
"@biomejs/biome": ["@biomejs/[email protected].4", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.2.4", "@biomejs/cli-darwin-x64": "2.2.4", "@biomejs/cli-linux-arm64": "2.2.4", "@biomejs/cli-linux-arm64-musl": "2.2.4", "@biomejs/cli-linux-x64": "2.2.4", "@biomejs/cli-linux-x64-musl": "2.2.4", "@biomejs/cli-win32-arm64": "2.2.4", "@biomejs/cli-win32-x64": "2.2.4" }, "bin": { "biome": "bin/biome" } }, "sha512-TBHU5bUy/Ok6m8c0y3pZiuO/BZoY/OcGxoLlrfQof5s8ISVwbVBdFINPQZyFfKwil8XibYWb7JMwnT8wT4WVPg=="],
263263

264-
"@biomejs/cli-darwin-arm64": ["@biomejs/[email protected].0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-zKbwUUh+9uFmWfS8IFxmVD6XwqFcENjZvEyfOxHs1epjdH3wyyMQG80FGDsmauPwS2r5kXdEM0v/+dTIA9FXAg=="],
264+
"@biomejs/cli-darwin-arm64": ["@biomejs/[email protected].4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-RJe2uiyaloN4hne4d2+qVj3d3gFJFbmrr5PYtkkjei1O9c+BjGXgpUPVbi8Pl8syumhzJjFsSIYkcLt2VlVLMA=="],
265265

266-
"@biomejs/cli-darwin-x64": ["@biomejs/[email protected].0", "", { "os": "darwin", "cpu": "x64" }, "sha512-+OmT4dsX2eTfhD5crUOPw3RPhaR+SKVspvGVmSdZ9y9O/AgL8pla6T4hOn1q+VAFBHuHhsdxDRJgFCSC7RaMOw=="],
266+
"@biomejs/cli-darwin-x64": ["@biomejs/[email protected].4", "", { "os": "darwin", "cpu": "x64" }, "sha512-cFsdB4ePanVWfTnPVaUX+yr8qV8ifxjBKMkZwN7gKb20qXPxd/PmwqUH8mY5wnM9+U0QwM76CxFyBRJhC9tQwg=="],
267267

268-
"@biomejs/cli-linux-arm64": ["@biomejs/[email protected].0", "", { "os": "linux", "cpu": "arm64" }, "sha512-6eoRdF2yW5FnW9Lpeivh7Mayhq0KDdaDMYOJnH9aT02KuSIX5V1HmWJCQQPwIQbhDh68Zrcpl8inRlTEan0SXw=="],
268+
"@biomejs/cli-linux-arm64": ["@biomejs/[email protected].4", "", { "os": "linux", "cpu": "arm64" }, "sha512-M/Iz48p4NAzMXOuH+tsn5BvG/Jb07KOMTdSVwJpicmhN309BeEyRyQX+n1XDF0JVSlu28+hiTQ2L4rZPvu7nMw=="],
269269

270-
"@biomejs/cli-linux-arm64-musl": ["@biomejs/[email protected].0", "", { "os": "linux", "cpu": "arm64" }, "sha512-egKpOa+4FL9YO+SMUMLUvf543cprjevNc3CAgDNFLcjknuNMcZ0GLJYa3EGTCR2xIkIUJDVneBV3O9OcIlCEZQ=="],
270+
"@biomejs/cli-linux-arm64-musl": ["@biomejs/[email protected].4", "", { "os": "linux", "cpu": "arm64" }, "sha512-7TNPkMQEWfjvJDaZRSkDCPT/2r5ESFPKx+TEev+I2BXDGIjfCZk2+b88FOhnJNHtksbOZv8ZWnxrA5gyTYhSsQ=="],
271271

272-
"@biomejs/cli-linux-x64": ["@biomejs/[email protected].0", "", { "os": "linux", "cpu": "x64" }, "sha512-5UmQx/OZAfJfi25zAnAGHUMuOd+LOsliIt119x2soA2gLggQYrVPA+2kMUxR6Mw5M1deUF/AWWP2qpxgH7Nyfw=="],
272+
"@biomejs/cli-linux-x64": ["@biomejs/[email protected].4", "", { "os": "linux", "cpu": "x64" }, "sha512-orr3nnf2Dpb2ssl6aihQtvcKtLySLta4E2UcXdp7+RTa7mfJjBgIsbS0B9GC8gVu0hjOu021aU8b3/I1tn+pVQ=="],
273273

274-
"@biomejs/cli-linux-x64-musl": ["@biomejs/[email protected].0", "", { "os": "linux", "cpu": "x64" }, "sha512-I5J85yWwUWpgJyC1CcytNSGusu2p9HjDnOPAFG4Y515hwRD0jpR9sT9/T1cKHtuCvEQ/sBvx+6zhz9l9wEJGAg=="],
274+
"@biomejs/cli-linux-x64-musl": ["@biomejs/[email protected].4", "", { "os": "linux", "cpu": "x64" }, "sha512-m41nFDS0ksXK2gwXL6W6yZTYPMH0LughqbsxInSKetoH6morVj43szqKx79Iudkp8WRT5SxSh7qVb8KCUiewGg=="],
275275

276-
"@biomejs/cli-win32-arm64": ["@biomejs/[email protected].0", "", { "os": "win32", "cpu": "arm64" }, "sha512-n9a1/f2CwIDmNMNkFs+JI0ZjFnMO0jdOyGNtihgUNFnlmd84yIYY2KMTBmMV58ZlVHjgmY5Y6E1hVTnSRieggA=="],
276+
"@biomejs/cli-win32-arm64": ["@biomejs/[email protected].4", "", { "os": "win32", "cpu": "arm64" }, "sha512-NXnfTeKHDFUWfxAefa57DiGmu9VyKi0cDqFpdI+1hJWQjGJhJutHPX0b5m+eXvTKOaf+brU+P0JrQAZMb5yYaQ=="],
277277

278-
"@biomejs/cli-win32-x64": ["@biomejs/[email protected].0", "", { "os": "win32", "cpu": "x64" }, "sha512-Nawu5nHjP/zPKTIryh2AavzTc/KEg4um/MxWdXW0A6P/RZOyIpa7+QSjeXwAwX/utJGaCoXRPWtF3m5U/bB3Ww=="],
278+
"@biomejs/cli-win32-x64": ["@biomejs/[email protected].4", "", { "os": "win32", "cpu": "x64" }, "sha512-3Y4V4zVRarVh/B/eSHczR4LYoSVyv3Dfuvm3cWs5w/HScccS0+Wt/lHOcDTRYeHjQmMYVC3rIRWqyN2EI52+zg=="],
279279

280280
"@biomejs/js-api": ["@biomejs/[email protected]", "", { "peerDependencies": { "@biomejs/wasm-bundler": "^2.2.0", "@biomejs/wasm-nodejs": "^2.2.0", "@biomejs/wasm-web": "^2.2.0" }, "optionalPeers": ["@biomejs/wasm-bundler", "@biomejs/wasm-nodejs", "@biomejs/wasm-web"] }, "sha512-5QcGJFj9IO+yXl76ICjvkdE38uxRcTDsBzcCZHEZ+ma+Te/nbvJg4A3KtAds9HCrEF0JKLWiyjMhAbqazuJvYA=="],
281281

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
"deploy": "bun run deploy:web"
2323
},
2424
"devDependencies": {
25-
"@biomejs/biome": "2.2.0",
26-
"@types/bun": "latest",
25+
"@biomejs/biome": "2.2.4",
26+
"@types/bun": "^1.2.22",
2727
"changelogithub": "^13.16.0",
2828
"husky": "^9.1.7",
29-
"lint-staged": "^16.1.5",
29+
"lint-staged": "^16.2.1",
3030
"turbo": "^2.5.8",
3131
"typescript": "5.9.2"
3232
},

0 commit comments

Comments
 (0)