From 628b973bbad23b25518b23f13a1eae03734de17b Mon Sep 17 00:00:00 2001 From: Ian Macabulos Date: Sat, 17 Jan 2026 14:13:29 +0800 Subject: [PATCH] test: mock missing frontend file to fix CI hang --- test/backend-test/test-issue-6586.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/backend-test/test-issue-6586.js b/test/backend-test/test-issue-6586.js index 6377ae4fb..ebf580ec7 100644 --- a/test/backend-test/test-issue-6586.js +++ b/test/backend-test/test-issue-6586.js @@ -3,16 +3,29 @@ const { UP } = require("../../src/util"); const dayjs = require("dayjs"); const { describe, test, beforeEach, afterEach } = require("node:test"); const assert = require("node:assert"); +const fs = require("fs"); +const path = require("path"); -// Load server but don't let it hang the process +// --- FIX: Create dummy index.html so server.js doesn't crash on CI --- +// The server expects 'dist/index.html' to exist. If missing, we create a fake one. +const distPath = path.join(__dirname, "../../dist"); +if (!fs.existsSync(distPath)) { + fs.mkdirSync(distPath, { recursive: true }); +} +const indexPath = path.join(distPath, "index.html"); +if (!fs.existsSync(indexPath)) { + fs.writeFileSync(indexPath, "Dummy"); +} +// --------------------------------------------------------------------- + +// Now it is safe to load the server require("../../server/server"); describe("Issue #6663: Push Monitor Retry Reset", () => { let monitorId; beforeEach(async () => { - // Wait for database to be ready before starting - // (A simple delay to ensure server startup logic processes) + // Wait for database to be ready await new Promise(resolve => setTimeout(resolve, 1000)); monitorId = await R.store(R.dispense("monitor"));