Luigit
repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by admin

extensions/decay/__tests__/harness.test.ts

Raw
import { afterEach, describe, expect, it } from "vitest";
import { createTestSession, type TestSession } from "../../../test/harness";
import decayExtension from "../index";

describe("decay pi-test-harness", () => {
	let testSession: TestSession | undefined;

	afterEach(() => {
		testSession?.dispose();
		testSession = undefined;
	});

	it("loads through the real Pi extension runtime", async () => {
		testSession = await createTestSession({
			extensionFactories: [decayExtension],
		});

		expect(testSession.session.extensionRunner.extensions).toHaveLength(1);
		expect(
			testSession.session.extensionRunner.hasHandlers("session_before_compact"),
		).toBe(true);
	});
});