Skip to content

Commit 13925f2

Browse files
committed
fix: convert tests, remove vitest dependency, add deps
1 parent ac619a5 commit 13925f2

File tree

6 files changed

+22
-639
lines changed

6 files changed

+22
-639
lines changed

apps/api/src/routes/public/flags.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, expect, it } from 'vitest';
1+
import { describe, expect, it } from 'bun:test';
22
import {
33
evaluateFlag,
44
evaluateRule,
@@ -822,7 +822,7 @@ describe('Flag Evaluation System', () => {
822822
// First evaluation - establish baseline
823823
for (const userId of testUserIds) {
824824
for (const flag of flags) {
825-
const context = contexts.find((c) => c.userId === userId);
825+
const context = contexts.find((c) => c.userId === userId)!;
826826
const result = evaluateFlag(flag, context);
827827
baselineResults[`${userId}-${flag.key}`] = result.enabled;
828828
}
@@ -831,7 +831,7 @@ describe('Flag Evaluation System', () => {
831831
for (let evaluation = 0; evaluation < 1000; evaluation++) {
832832
for (const userId of testUserIds) {
833833
for (const flag of flags) {
834-
const context = contexts.find((c) => c.userId === userId);
834+
const context = contexts.find((c) => c.userId === userId)!;
835835
const result = evaluateFlag(flag, context);
836836
const key = `${userId}-${flag.key}`;
837837

apps/basket/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
"dependencies": {
1010
"@clickhouse/client": "catalog:",
1111
"@clickhouse/client-web": "catalog:",
12-
"@databuddy/auth": "../../packages/auth",
13-
"@databuddy/redis": "../../packages/redis",
14-
"@databuddy/validation": "../../packages/validation",
12+
"@databuddy/auth": "workspace:*",
13+
"@databuddy/redis": "workspace:*",
14+
"@databuddy/db": "workspace:*",
15+
"@databuddy/validation": "workspace:*",
1516
"@elysiajs/cors": "^1.3.3",
1617
"@elysiajs/server-timing": "^1.3.0",
1718
"@logtail/edge": "catalog:",
1819
"@logtail/js": "catalog:",
1920
"@logtail/pino": "catalog:",
2021
"@maxmind/geoip2-node": "^6.1.0",
2122
"@types/ua-parser-js": "^0.7.39",
22-
"@vitest/coverage-v8": "^3.2.4",
2323
"autumn-js": "catalog:",
2424
"dayjs": "catalog:",
2525
"elysia": "catalog:",
@@ -31,8 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"bun-types": "latest",
34-
"c8": "^8.0.0",
35-
"vitest": "^3.2.4"
34+
"c8": "^8.0.0"
3635
},
3736
"module": "src/index.js"
3837
}

apps/basket/src/hooks/auth.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, expect, it } from 'vitest';
1+
import { describe, expect, it } from 'bun:test';
22
import { logger } from '../lib/logger';
33
import {
44
isLocalhost,

apps/basket/src/utils/ip-geo.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { beforeEach, describe, expect, it } from 'vitest';
1+
import { beforeEach, describe, expect, it } from 'bun:test';
22
import {
33
anonymizeIp,
44
extractIpFromRequest,

apps/basket/src/utils/user-agent.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, expect, it } from 'vitest';
1+
import { describe, expect, it } from 'bun:test';
22
import { detectBot, parseUserAgent } from './user-agent';
33

44
describe('User Agent Utilities', () => {

0 commit comments

Comments
 (0)