Initial import of verae-jobs-events from zapier monorepo

This commit is contained in:
George Lambert 2026-09-11 19:54:52 -04:00
commit 4e9ccffbbe
6 changed files with 130 additions and 0 deletions

23
test/health.test.js Normal file
View file

@ -0,0 +1,23 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { spawn } from 'node:child_process';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
test('jobs-events health', async () => {
const port = 18030;
const child = spawn(process.execPath, ['src/server.js'], {
cwd: root,
env: { ...process.env, PORT: String(port) },
stdio: ['ignore', 'pipe', 'pipe'],
});
await new Promise((r) => setTimeout(r, 400));
try {
const h = await (await fetch(`http://127.0.0.1:${port}/health`)).json();
assert.equal(h.role, 'verae-jobs-events');
} finally {
child.kill('SIGTERM');
}
});