Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
19978a7
fix: tests
moreorover Nov 8, 2025
cd98ec0
fix: tests
moreorover Nov 8, 2025
6f20ff6
fix: tests
moreorover Nov 8, 2025
b7e6568
initial commit
moreorover Nov 8, 2025
d48592f
Merge branch 'main' into fix/tests
moreorover Nov 8, 2025
d73c915
fix: setup pnpm
moreorover Nov 8, 2025
4d33b3d
fix: setup git user
moreorover Nov 8, 2025
a17d400
fix: setup git user
moreorover Nov 8, 2025
f744cfa
fix: coverage
moreorover Nov 8, 2025
c486e3b
remove .idea
moreorover Nov 8, 2025
baa7340
remove .idea
moreorover Nov 8, 2025
78dc847
run tests from root
moreorover Nov 8, 2025
1e112f3
increase test timeout
moreorover Nov 8, 2025
4478fa0
fix: codecov
moreorover Nov 8, 2025
c2732c6
fix: codecov
moreorover Nov 9, 2025
b1608a3
fix: coverage skip test files
moreorover Nov 9, 2025
86c08d1
Merge branch 'main' into fix/tests
moreorover Nov 10, 2025
dffee34
Merge branch 'main' into fix/tests
AmanVarshney01 Nov 10, 2025
1401ab9
Merge branch 'main' into fix/tests
moreorover Nov 10, 2025
5133348
fix: fix tests
moreorover Nov 11, 2025
9b21cf7
fix: fix tests
moreorover Nov 11, 2025
8b9a882
Revert "fix: fix tests"
moreorover Nov 11, 2025
659d2c9
fix: fix tests
moreorover Nov 11, 2025
829117e
Revert "fix: fix tests"
moreorover Nov 11, 2025
4964ecb
fix: fix tests
moreorover Nov 11, 2025
3eb883d
Merge branch 'main' into fix/tests
moreorover Nov 12, 2025
5e20990
Merge branch 'main' into fix/tests
moreorover Nov 26, 2025
61ff06e
fix: fix tests
moreorover Nov 26, 2025
a5ef83f
fix: fix tests
moreorover Nov 26, 2025
954c18d
fix: fix tests
moreorover Nov 26, 2025
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
46 changes: 46 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test

on:
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup Git user
shell: bash
run: |
git config --global user.name github-actions[bot]
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Install Dependencies
run: bun install --frozen-lockfile
env:
BTS_TELEMETRY: 1
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }}

- name: Run Tests
run: bun test --timeout 15000

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage/lcov.info
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ yarn-error.log*
.vscode
.env*.local

.smoke
.smoke

.idea
11 changes: 10 additions & 1 deletion apps/cli/test/addons.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { describe, it } from "vitest";
import { afterAll, beforeAll, describe, it } from "vitest";
import type { Addons, Frontend } from "../src";
import {
cleanupSmokeDirectory,
expectError,
expectSuccess,
runTRPCTest,
type TestConfig,
} from "./test-utils";

describe("Addon Configurations", () => {
beforeAll(async () => {
await cleanupSmokeDirectory();
});

afterAll(async () => {
await cleanupSmokeDirectory();
});

describe("Universal Addons (no frontend restrictions)", () => {
const universalAddons = ["biome", "husky", "turborepo", "oxlint"];

Expand Down
11 changes: 10 additions & 1 deletion apps/cli/test/api.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from "vitest";
import { afterAll, beforeAll, describe, it } from "vitest";
import type {
API,
Backend,
Expand All @@ -10,13 +10,22 @@ import type {
} from "../src/types";
import {
API_TYPES,
cleanupSmokeDirectory,
expectError,
expectSuccess,
runTRPCTest,
type TestConfig,
} from "./test-utils";

describe("API Configurations", () => {
beforeAll(async () => {
await cleanupSmokeDirectory();
});

afterAll(async () => {
await cleanupSmokeDirectory();
});

describe("tRPC API", () => {
it("should work with tRPC + React frontends", async () => {
const reactFrontends = [
Expand Down
16 changes: 14 additions & 2 deletions apps/cli/test/auth.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { describe, it } from "vitest";
import { afterAll, beforeAll, describe, it } from "vitest";
import type { Backend, Database, Frontend, ORM } from "../src/types";
import {
AUTH_PROVIDERS,
cleanupSmokeDirectory,
expectError,
expectSuccess,
runTRPCTest,
type TestConfig,
} from "./test-utils";

describe("Authentication Configurations", () => {
beforeAll(async () => {
await cleanupSmokeDirectory();
});

afterAll(async () => {
await cleanupSmokeDirectory();
});

describe("Better-Auth Provider", () => {
it("should work with better-auth + database", async () => {
const result = await runTRPCTest({
Expand Down Expand Up @@ -95,7 +104,10 @@ describe("Authentication Configurations", () => {
expectError: true,
});

expectError(result, "Authentication requires a database");
expectError(
result,
"The 'todo' example requires a database if a backend (other than Convex) is present. Cannot use --examples todo when database is 'none' and a backend is selected.",
);
});

it("should work with better-auth + convex backend (tanstack-router)", async () => {
Expand Down
13 changes: 11 additions & 2 deletions apps/cli/test/backend-runtime.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { describe, it } from "vitest";
import { afterAll, beforeAll, describe, it } from "vitest";
import type { Backend, Frontend, Runtime } from "../src/types";
import {
cleanupSmokeDirectory,
expectError,
expectSuccess,
runTRPCTest,
type TestConfig,
} from "./test-utils";

describe("Backend and Runtime Combinations", () => {
beforeAll(async () => {
await cleanupSmokeDirectory();
});

afterAll(async () => {
await cleanupSmokeDirectory();
});

describe("Valid Backend-Runtime Combinations", () => {
const validCombinations = [
// Standard backend-runtime combinations
Expand Down Expand Up @@ -464,7 +473,7 @@ describe("Backend and Runtime Combinations", () => {

expectError(
result,
"Backend 'self' (fullstack) currently only supports Next.js frontend. Please use --frontend next. Support for Nuxt, SvelteKit, and TanStack Start will be added in a future update.",
"Backend 'self' (fullstack) currently only supports Next.js and TanStack Start frontends. Please use --frontend next or --frontend tanstack-start. Support for Nuxt and SvelteKit will be added in a future update.",
);
});

Expand Down
11 changes: 10 additions & 1 deletion apps/cli/test/basic-configurations.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { describe, expect, it } from "vitest";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import {
cleanupSmokeDirectory,
expectError,
expectSuccess,
PACKAGE_MANAGERS,
runTRPCTest,
} from "./test-utils";

describe("Basic Configurations", () => {
beforeAll(async () => {
await cleanupSmokeDirectory();
});

afterAll(async () => {
await cleanupSmokeDirectory();
});

describe("Default Configuration", () => {
it("should create project with --yes flag (default config)", async () => {
const result = await runTRPCTest({
Expand Down
Loading