mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
25 lines
667 B
TypeScript
25 lines
667 B
TypeScript
/* import { afterAll, beforeAll, describe, expect, it } from "bun:test";
|
|
import { AppDataSource } from "~database/datasource";
|
|
import { Instance } from "~database/entities/Instance";
|
|
|
|
let instance: Instance;
|
|
|
|
beforeAll(async () => {
|
|
if (!AppDataSource.isInitialized) await AppDataSource.initialize();
|
|
});
|
|
|
|
describe("Instance", () => {
|
|
it("should add an instance to the database if it doesn't already exist", async () => {
|
|
const url = "https://mastodon.social";
|
|
instance = await Instance.addIfNotExists(url);
|
|
expect(instance.base_url).toBe("mastodon.social");
|
|
});
|
|
});
|
|
|
|
afterAll(async () => {
|
|
await instance.remove();
|
|
|
|
await AppDataSource.destroy();
|
|
});
|
|
*/
|