refactor(cleanup): completar fase 5 con renombrados semánticos

This commit is contained in:
Pandipipas
2026-02-21 18:55:30 +01:00
parent 8047c99946
commit 710fea38c0
7 changed files with 114 additions and 113 deletions
+27 -27
View File
@@ -23,8 +23,8 @@ function getBaseConfig(): AppRuntimeConfig {
userModelId: "com.scoreko.desktop",
nodecgPort: "9090",
bundleName: "scoreko-dev",
dashboardRoute: "dashboard/scoreko-dev/main.html?standalone=true",
loadingRoute: "dashboard/loading/main.html?standalone=true",
mainDashboardRoute: "dashboard/scoreko-dev/main.html?standalone=true",
loadingDashboardRoute: "dashboard/loading/main.html?standalone=true",
loadDelayMs: 10000,
startupTimeoutMs: 100,
nodecgKillTimeoutMs: 10,
@@ -34,9 +34,9 @@ function getBaseConfig(): AppRuntimeConfig {
test("startNodeCG valida instalación de NodeCG antes de arrancar", () => {
const manager = createNodecgProcessManager({
isDev: true,
nodecgPath: "/fake/nodecg",
baseUrl: "http://127.0.0.1:9090",
runtimeConfig: getBaseConfig(),
nodecgRootPath: "/fake/nodecg",
nodecgBaseUrl: "http://127.0.0.1:9090",
appConfig: getBaseConfig(),
log: () => undefined,
deps: {
pathExists: () => false,
@@ -47,7 +47,7 @@ test("startNodeCG valida instalación de NodeCG antes de arrancar", () => {
});
assert.throws(() => {
manager.startNodeCG();
manager.startNodecgProcess();
}, /No existe la carpeta NodeCG/);
});
@@ -55,9 +55,9 @@ test("waitForNodeCGReady resuelve cuando el endpoint responde 404", async () =>
const child = new MockChildProcess(4321);
const manager = createNodecgProcessManager({
isDev: true,
nodecgPath: "/fake/nodecg",
baseUrl: "http://127.0.0.1:9090",
runtimeConfig: getBaseConfig(),
nodecgRootPath: "/fake/nodecg",
nodecgBaseUrl: "http://127.0.0.1:9090",
appConfig: getBaseConfig(),
log: () => undefined,
deps: {
pathExists: () => true,
@@ -72,9 +72,9 @@ test("waitForNodeCGReady resuelve cuando el endpoint responde 404", async () =>
},
});
manager.startNodeCG();
manager.startNodecgProcess();
await assert.doesNotReject(async () => {
await manager.waitForNodeCGReady(Date.now());
await manager.waitForNodecgReady(Date.now());
});
});
@@ -85,9 +85,9 @@ test("stopNodeCG envía SIGTERM y luego SIGKILL si el proceso no sale", async ()
const manager = createNodecgProcessManager({
isDev: true,
nodecgPath: "/fake/nodecg",
baseUrl: "http://127.0.0.1:9090",
runtimeConfig: getBaseConfig(),
nodecgRootPath: "/fake/nodecg",
nodecgBaseUrl: "http://127.0.0.1:9090",
appConfig: getBaseConfig(),
log: () => undefined,
deps: {
pathExists: () => true,
@@ -105,8 +105,8 @@ test("stopNodeCG envía SIGTERM y luego SIGKILL si el proceso no sale", async ()
},
});
manager.startNodeCG();
const stopPromise = manager.stopNodeCG();
manager.startNodecgProcess();
const stopPromise = manager.stopNodecgProcessGracefully();
assert.deepEqual(killSignals, [{ pid: -9999, signal: "SIGTERM" }]);
@@ -129,9 +129,9 @@ test("stopNodeCG reutiliza la misma promesa cuando se invoca en paralelo", async
const manager = createNodecgProcessManager({
isDev: true,
nodecgPath: "/fake/nodecg",
baseUrl: "http://127.0.0.1:9090",
runtimeConfig: getBaseConfig(),
nodecgRootPath: "/fake/nodecg",
nodecgBaseUrl: "http://127.0.0.1:9090",
appConfig: getBaseConfig(),
log: () => undefined,
deps: {
pathExists: () => true,
@@ -144,9 +144,9 @@ test("stopNodeCG reutiliza la misma promesa cuando se invoca en paralelo", async
},
});
manager.startNodeCG();
const firstStop = manager.stopNodeCG();
const secondStop = manager.stopNodeCG();
manager.startNodecgProcess();
const firstStop = manager.stopNodecgProcessGracefully();
const secondStop = manager.stopNodecgProcessGracefully();
assert.equal(firstStop, secondStop);
@@ -160,9 +160,9 @@ test("stopNodeCG normaliza timeout negativo a cero", async () => {
const manager = createNodecgProcessManager({
isDev: true,
nodecgPath: "/fake/nodecg",
baseUrl: "http://127.0.0.1:9090",
runtimeConfig: {
nodecgRootPath: "/fake/nodecg",
nodecgBaseUrl: "http://127.0.0.1:9090",
appConfig: {
...getBaseConfig(),
nodecgKillTimeoutMs: -10,
},
@@ -182,8 +182,8 @@ test("stopNodeCG normaliza timeout negativo a cero", async () => {
},
});
manager.startNodeCG();
const stopPromise = manager.stopNodeCG();
manager.startNodecgProcess();
const stopPromise = manager.stopNodecgProcessGracefully();
assert.ok(timeouts.includes(0));