test(gateway): harden tools invoke cron regression harness

This commit is contained in:
Vincent Koc
2026-04-11 10:39:56 +01:00
parent ebb72baba3
commit 688327311c

View File

@@ -76,14 +76,18 @@ let server: ReturnType<typeof createServer> | undefined;
beforeAll(async () => {
server = createServer((req, res) => {
void handleToolsInvokeHttpRequest(req, res, {
auth: { mode: "token", token: TEST_GATEWAY_TOKEN, allowTailscale: false },
}).then((handled) => {
void (async () => {
const handled = await handleToolsInvokeHttpRequest(req, res, {
auth: { mode: "token", token: TEST_GATEWAY_TOKEN, allowTailscale: false },
});
if (handled) {
return;
}
res.statusCode = 404;
res.end("not found");
})().catch((err) => {
res.statusCode = 500;
res.end(String(err));
});
});
await new Promise<void>((resolve, reject) => {