mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-02-08 04:21:18 -05:00
* test: backups service * refactor: create hono app in a separate file To avoid side effects like db migration or startup scripts when testing test(backups): add security tests to the backups controller * ci: run typechecks, build and tests on PR * test: controllers security tests * chore: update lock file * refactor: pr feedbacks
20 lines
474 B
TypeScript
20 lines
474 B
TypeScript
import { beforeAll, mock } from "bun:test";
|
|
import { migrate } from "drizzle-orm/bun-sqlite/migrator";
|
|
import path from "node:path";
|
|
import { cwd } from "node:process";
|
|
import { db } from "~/server/db/db";
|
|
|
|
mock.module("~/server/utils/logger", () => ({
|
|
logger: {
|
|
debug: () => {},
|
|
info: () => {},
|
|
warn: () => {},
|
|
error: () => {},
|
|
},
|
|
}));
|
|
|
|
beforeAll(async () => {
|
|
const migrationsFolder = path.join(cwd(), "app", "drizzle");
|
|
migrate(db, { migrationsFolder });
|
|
});
|