mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { runAppShutdownRuntimeService } from "./app-shutdown-runtime-service";
|
|
|
|
test("runAppShutdownRuntimeService runs teardown steps in order", () => {
|
|
const calls: string[] = [];
|
|
runAppShutdownRuntimeService({
|
|
unregisterAllGlobalShortcuts: () => calls.push("unregisterAllGlobalShortcuts"),
|
|
stopSubtitleWebsocket: () => calls.push("stopSubtitleWebsocket"),
|
|
stopTexthookerService: () => calls.push("stopTexthookerService"),
|
|
destroyYomitanParserWindow: () => calls.push("destroyYomitanParserWindow"),
|
|
clearYomitanParserPromises: () => calls.push("clearYomitanParserPromises"),
|
|
stopWindowTracker: () => calls.push("stopWindowTracker"),
|
|
destroyMpvSocket: () => calls.push("destroyMpvSocket"),
|
|
clearReconnectTimer: () => calls.push("clearReconnectTimer"),
|
|
destroySubtitleTimingTracker: () => calls.push("destroySubtitleTimingTracker"),
|
|
destroyAnkiIntegration: () => calls.push("destroyAnkiIntegration"),
|
|
});
|
|
|
|
assert.deepEqual(calls, [
|
|
"unregisterAllGlobalShortcuts",
|
|
"stopSubtitleWebsocket",
|
|
"stopTexthookerService",
|
|
"destroyYomitanParserWindow",
|
|
"clearYomitanParserPromises",
|
|
"stopWindowTracker",
|
|
"destroyMpvSocket",
|
|
"clearReconnectTimer",
|
|
"destroySubtitleTimingTracker",
|
|
"destroyAnkiIntegration",
|
|
]);
|
|
});
|