Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions shared/connections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"./rtc/worker": "./src/rtc/worker/index.ts"
},
"scripts": {
"test:unit": "bun test"
"test:unit": "vitest run"
},
"dependencies": {
"@cyrus/errors": "workspace:*",
Expand All @@ -24,6 +24,6 @@
},
"devDependencies": {
"@cyrus/typescript": "workspace:*",
"@types/bun": "catalog:"
"vitest": "catalog:"
}
}
2 changes: 1 addition & 1 deletion shared/connections/src/rtc/peer.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import type { ServerEvent } from "@cyrus/schemas/signaling";
import { describe, expect, test } from "vitest";
import { createSignalingEvents } from "./peer";

async function* eventStream(events: ServerEvent[]) {
Expand Down
2 changes: 1 addition & 1 deletion shared/connections/src/rtc/session.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import { normalizeHost } from "./session";

describe("normalizeHost", () => {
Expand Down
2 changes: 1 addition & 1 deletion shared/connections/src/rtc/webrtc-nightly.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import { RTCPeerConnection as NodeRTCPeerConnection } from "node-datachannel/polyfill";
import { describe, expect, test } from "vitest";

const nightlyDescribe =
process.env.CYRUS_NIGHTLY_WEBRTC === "1" ? describe : describe.skip;
Expand Down
2 changes: 1 addition & 1 deletion shared/connections/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"types": [],
"strictNullChecks": true
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"include": ["src/**/*.ts", "src/**/*.tsx", "vitest.config.ts"],
"exclude": ["node_modules"]
}
8 changes: 8 additions & 0 deletions shared/connections/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
environment: "node",
include: ["src/**/*.test.ts"],
},
});
5 changes: 3 additions & 2 deletions shared/constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
},
"scripts": {
"check:types": "tsc --noEmit",
"test:unit": "bun test"
"test:unit": "vitest run"
},
"devDependencies": {
"@cyrus/typescript": "workspace:*",
"@types/bun": "catalog:",
"typescript": "catalog:"
"typescript": "catalog:",
"vitest": "catalog:"
}
}
2 changes: 1 addition & 1 deletion shared/constants/src/operation-keys.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import {
AUTH_OPERATION_KEYS,
RTC_OPERATION_KEYS,
Expand Down
2 changes: 1 addition & 1 deletion shared/constants/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"types": ["bun"],
"strictNullChecks": true
},
"include": ["src/**/*.ts"],
"include": ["src/**/*.ts", "vitest.config.ts"],
"exclude": ["node_modules"]
}
8 changes: 8 additions & 0 deletions shared/constants/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
environment: "node",
include: ["src/**/*.test.ts"],
},
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { describe, expect, test } from "bun:test";
import {
appendConversation,
getConversations,
Expand All @@ -16,6 +15,7 @@ import {
renameThread,
threadNameFromPrompt,
} from "@cyrus/database/repositories/threads";
import { describe, expect, test } from "vitest";
import { withTempDatabase } from "../helpers/turso";

describe("database repositories", () => {
Expand Down
6 changes: 4 additions & 2 deletions shared/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"check:types": "tsc --noEmit",
"db:push": "dotenvx run -- drizzle-kit push",
"db:studio": "dotenvx run -- drizzle-kit studio",
"test:integration": "bun test __tests__/integration"
"test:unit": "vitest run src",
"test:integration": "vitest run __tests__/integration"
},
"dependencies": {
"@cyrus/errors": "workspace:*",
Expand All @@ -27,6 +28,7 @@
"@cyrus/typescript": "workspace:*",
"@tursodatabase/database": "^0.6.1",
"@types/bun": "catalog:",
"typescript": "catalog:"
"typescript": "catalog:",
"vitest": "catalog:"
}
}
2 changes: 1 addition & 1 deletion shared/database/src/utils/repo.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { describe, expect, test } from "bun:test";
import {
notFound,
persistFailed,
Expand All @@ -7,6 +6,7 @@ import {
RepositoryPersistFailedError,
} from "@cyrus/errors/repository";
import { DrizzleQueryError } from "drizzle-orm";
import { describe, expect, test } from "vitest";
import { z } from "zod";
import {
fromDrizzleFailure,
Expand Down
7 changes: 6 additions & 1 deletion shared/database/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"types": ["bun"],
"strictNullChecks": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "__tests__/**/*.ts"],
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"__tests__/**/*.ts",
"vitest.config.ts"
],
"exclude": ["node_modules"]
}
8 changes: 8 additions & 0 deletions shared/database/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
environment: "node",
include: ["src/**/*.test.ts", "__tests__/integration/**/*.test.ts"],
},
});
5 changes: 3 additions & 2 deletions shared/schemas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
"./signaling": "./src/signaling.ts"
},
"scripts": {
"test:unit": "bun test"
"test:unit": "vitest run"
},
"dependencies": {
"zod": "catalog:"
},
"devDependencies": {
"@cyrus/typescript": "workspace:*",
"@types/bun": "catalog:"
"@types/bun": "catalog:",
"vitest": "catalog:"
}
}
2 changes: 1 addition & 1 deletion shared/schemas/src/rtc/agents.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import { ListAgentsOutputSchema } from "./agents";

describe("ListAgentsOutputSchema", () => {
Expand Down
2 changes: 1 addition & 1 deletion shared/schemas/src/rtc/chat.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import {
AgentEventSchema,
ChatChunkSchema,
Expand Down
2 changes: 1 addition & 1 deletion shared/schemas/src/rtc/threads.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import {
ConversationEntrySchema,
RenameThreadInputSchema,
Expand Down
2 changes: 1 addition & 1 deletion shared/schemas/src/signaling.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import {
DeviceInfoSchema,
DeviceRoleSchema,
Expand Down
2 changes: 1 addition & 1 deletion shared/schemas/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"types": ["bun"],
"strictNullChecks": true
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"include": ["src/**/*.ts", "src/**/*.tsx", "vitest.config.ts"],
"exclude": ["node_modules"]
}
8 changes: 8 additions & 0 deletions shared/schemas/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
environment: "node",
include: ["src/**/*.test.ts"],
},
});
5 changes: 3 additions & 2 deletions shared/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"./*": "./src/*.ts"
},
"scripts": {
"test:unit": "bun test"
"test:unit": "vitest run"
},
"dependencies": {
"@cyrus/errors": "workspace:*",
Expand All @@ -20,6 +20,7 @@
"devDependencies": {
"@cyrus/typescript": "workspace:*",
"@types/bun": "catalog:",
"typescript": "catalog:"
"typescript": "catalog:",
"vitest": "catalog:"
}
}
2 changes: 1 addition & 1 deletion shared/utils/src/conversations/fold.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, test } from "bun:test";
import type { AgentEvent } from "@cyrus/schemas/rtc/chat";
import type { ConversationEntry } from "@cyrus/schemas/rtc/threads";
import { describe, expect, test } from "vitest";
import { fold } from "./fold";

function entry(
Expand Down
2 changes: 1 addition & 1 deletion shared/utils/src/conversations/thread-feed.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import { deriveFeed } from "./thread-feed";

describe("deriveFeed", () => {
Expand Down
2 changes: 1 addition & 1 deletion shared/utils/src/conversations/turn-waiters.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import { isTurnInterruptedError, turnWaitFailed } from "@cyrus/errors/turn";
import { describe, expect, test } from "vitest";
import {
rejectTurnWaiter,
settleTurnWaiter,
Expand Down
2 changes: 1 addition & 1 deletion shared/utils/src/identity.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import { generateName, randomId } from "./identity";

const UUID_PATTERN =
Expand Down
2 changes: 1 addition & 1 deletion shared/utils/src/path.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import {
appendBrowsePathSegment,
canNavigateUp,
Expand Down
2 changes: 1 addition & 1 deletion shared/utils/src/timer.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { describe, expect, test } from "vitest";
import { formatElapsedTimer, formatElapsedTimerNow } from "./timer";

describe("timer helpers", () => {
Expand Down
2 changes: 1 addition & 1 deletion shared/utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"types": ["bun"],
"strictNullChecks": true
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"include": ["src/**/*.ts", "src/**/*.tsx", "vitest.config.ts"],
"exclude": ["node_modules"]
}
8 changes: 8 additions & 0 deletions shared/utils/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
environment: "node",
include: ["src/**/*.test.ts"],
},
});
5 changes: 5 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ export default defineConfig({
projects: [
"apps/web/vitest.config.ts",
"apps/server/vitest.config.ts",
"shared/connections/vitest.config.ts",
"shared/constants/vitest.config.ts",
"shared/database/vitest.config.ts",
"shared/hooks/vitest.config.ts",
"shared/providers/vitest.config.ts",
"shared/schemas/vitest.config.ts",
"shared/utils/vitest.config.ts",
],
coverage: {
provider: "istanbul",
Expand Down