Self-hosted multi-platform broadcast newsroom for activist collectives: publishing pipeline with group approval and DST-proof scheduling, TweetDeck-style column wall with hostile-content-safe rendering, live control room with Auto Director, bridged chat governance with polls and quorum, distributed sandboxed transcode workers, encrypted content-addressed archive, monthly analytics. MIT licensed. See README.md and docs/.
31 lines
1.6 KiB
TypeScript
31 lines
1.6 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { LiveModule } from "./live.module.js";
|
|
import { LiveDestinationRepository } from "./live-destination.repository.js";
|
|
import { GoLiveService } from "./go-live.service.js";
|
|
import { StreamOutputController } from "./stream-output.controller.js";
|
|
import { LiveDestinationController } from "./live-destination.controller.js";
|
|
import type { INestApplicationContext } from "@nestjs/common";
|
|
import { NestFactory } from "@nestjs/core";
|
|
|
|
/**
|
|
* Module wiring smoke test: LiveModule is importable without a database (the
|
|
* registry registration is env-gated) and provides its services/controllers
|
|
* with the DI graph intact.
|
|
*/
|
|
describe("LiveModule wiring", () => {
|
|
it("provides the repository, go-live service and controllers", async () => {
|
|
const hadDatabaseUrl = process.env.DATABASE_URL; // registry registration is DB-gated; module must still construct
|
|
delete process.env.DATABASE_URL;
|
|
const app: INestApplicationContext = await NestFactory.createApplicationContext(LiveModule, { logger: false });
|
|
try {
|
|
expect(app.get(LiveDestinationRepository)).toBeInstanceOf(LiveDestinationRepository);
|
|
const goLive = app.get(GoLiveService, { strict: false });
|
|
expect(goLive).toBeInstanceOf(GoLiveService);
|
|
expect(app.get(LiveDestinationController)).toBeInstanceOf(LiveDestinationController);
|
|
expect(app.get(StreamOutputController)).toBeInstanceOf(StreamOutputController);
|
|
} finally {
|
|
await app.close();
|
|
if (hadDatabaseUrl !== undefined) process.env.DATABASE_URL = hadDatabaseUrl;
|
|
}
|
|
});
|
|
});
|