Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

625 B
Raw Blame
import { TestProject } from "vitest/node";

import { signUpUser } from "../utils/api";
import { getTrpcClient } from "../utils/trpc";

export async function setup({ provide }: TestProject) {
  const trpc = getTrpcClient();
  await signUpUser({
    name: "Test User",
    email: "[email protected]",
    password: "test1234",
  });

  const { key } = await trpc.apiKeys.exchange.mutate({
    email: "[email protected]",
    password: "test1234",
    keyName: "test-key",
  });
  provide("adminApiKey", key);
  return () => ({});
}

declare module "vitest" {
  export interface ProvidedContext {
    adminApiKey: string;
  }
}