mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-25 23:35:43 +00:00
26 lines
970 B
TypeScript
26 lines
970 B
TypeScript
import { readFileSync } from "node:fs";
|
|
import { fileURLToPath } from "node:url";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const recorderSource = readFileSync(
|
|
fileURLToPath(new URL("./ScreenCaptureKitRecorder.swift", import.meta.url)),
|
|
"utf8",
|
|
);
|
|
|
|
describe("ScreenCaptureKitRecorder finalization coordination", () => {
|
|
it("marks manual stops as participants in the shared finalization", () => {
|
|
expect(recorderSource).toContain("finalizeCapture(interactive: true)");
|
|
expect(recorderSource).toContain("finalization.outputResult.get()");
|
|
expect(recorderSource).toContain(
|
|
"self.interactiveStopParticipated = self.interactiveStopParticipated || interactive",
|
|
);
|
|
});
|
|
|
|
it("does not let automatic window-close exit preempt a joined manual stop", () => {
|
|
expect(recorderSource).toContain("self.finalizeCapture(interactive: false)");
|
|
expect(recorderSource).toMatch(
|
|
/if finalization\.interactiveStopParticipated\s*\{\s*return\s*\}/,
|
|
);
|
|
});
|
|
});
|