Files
bot-railway-template/test/reset-stops-gateway.test.js

12 lines
437 B
JavaScript

import test from "node:test";
import assert from "node:assert/strict";
import fs from "node:fs";
test("reset handler stops gateway before deleting config", () => {
const src = fs.readFileSync(new URL("../src/server.js", import.meta.url), "utf8");
const idx = src.indexOf('app.post("/setup/api/reset"');
assert.ok(idx >= 0);
const window = src.slice(idx, idx + 900);
assert.match(window, /gatewayProc\.kill\("SIGTERM"\)/);
});