test: migrate from bun to pnpm and vitest

This commit is contained in:
2025-12-06 18:14:01 -05:00
parent 20ad68669c
commit bdac969be9
31 changed files with 228 additions and 2103 deletions

View File

@@ -1,3 +1,26 @@
if (process.env.SHOULD_LOG_ERRORS === "false") {
console.error = () => {};
import { vi } from "vitest";
const shouldLogErrors = process.env["SHOULD_LOG_ERRORS"] === "true";
if (!shouldLogErrors) {
const originalConsoleError = console.error;
console.error = (...args) => {
// Suppress specific error messages
if (
args[0]?.includes?.("Error: No email provided") ||
args[0]?.includes?.('TypeError: "pkcs8" must be PKCS#8 formatted string')
) {
return;
}
originalConsoleError(...args);
};
}
global.fetch = vi.fn();
vi.mock("cloudflare:workers", () => {
return {
env: {},
DurableObject: class DurableObject {},
};
});